Results 1 to 7 of 7
  1. #1
    gheyman is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    22

    Set a Value in a table from a From button

    From a click event I want to set the value in a table

    I get an error with this;



    tblNavigation.Toggle_condition = False

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You can't do it that way. Normally the form would be bound to the table, and you'd just set the form control that holds that field. Failing that, you're looking at running an update query or using the update method of a recordset.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    the text box is bound to the field

    txtBox = tblNavButton.value

  4. #4
    gheyman is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    22
    You cant do something like this?

    Set rec = CurrentDb().OpenRecordset("tblNavigator")

    rec("Toggle_Condition") = False

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    That's...kind of...the recordset method I mentioned...with errors. What you have would change the first record in the table, not necessarily the record displayed on the form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    gheyman is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    22
    Thanks for the help

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No problem. Did you get it working?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. use a button to enter a value into a table
    By campbell707 in forum Forms
    Replies: 18
    Last Post: 12-27-2015, 12:01 AM
  2. Replies: 12
    Last Post: 11-11-2014, 02:10 PM
  3. Button to add attachments to a table
    By kdbailey in forum Access
    Replies: 1
    Last Post: 07-30-2014, 10:04 AM
  4. Replies: 1
    Last Post: 07-01-2014, 01:41 PM
  5. BUTTON keeps adding value to TABLE
    By taimysho0 in forum Programming
    Replies: 1
    Last Post: 11-16-2011, 03:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums