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

    VBA to Check a Record and set a field value based on the value in a different field

    I was hoping someone would help me with VBA code that is way beyond my capabilities right now. I assume this is possible to do.


    When the Toggle Button named ToggleBid is clicked and its value is = True then
    have code that would run through each record in a table (tblNavigator) and check on a field named "Bid_Tracker" if that records value in the Bid_Tracker field = "True" then set the value in the Field named "Toggle_Condition" to "True".

    Your help us very much appreciated, this would make things much easier for the users.

    ****Additional Information*********

    Not sure an Update meets my needs, I am not changing the field Bid_Tracker that has the True in it and I don't want to change Every record in the table. I just want the Field "Toggle_Condition to equal True if the field Bid_Tracker = "True"

    Like I said, I am new so maybe I don't understand all the capabilities of an Update query

    I was also going to use the code for a second and third toggle based on fields in addition to the Bid_Tracker. I know enough VBA from Excel to be able to take what someone helped out with and modify it. Then I was going run a query on the table (after the requested code above) to show only records where the Toggle_Condition was true.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    you dont need vb code, just run an update query to change the values.

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Can you create an Update query that accomplishes this task? BTW, it is not a good idea to have a field in a table based on another field in that same table.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    It would seem to me that whatever you want to do based on the toggle value can be accomplished based on the value that the toggle setting depends on. The additional field seems redundant.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 8
    Last Post: 03-29-2017, 09:07 AM
  2. Replies: 5
    Last Post: 12-07-2016, 09:28 PM
  3. Replies: 2
    Last Post: 07-27-2015, 05:20 PM
  4. Replies: 3
    Last Post: 09-19-2014, 08:22 AM
  5. Check if record exists based off one field
    By cactuspete13 in forum Forms
    Replies: 3
    Last Post: 01-14-2013, 05:56 PM

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