Results 1 to 6 of 6
  1. #1
    donnie.atchison is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jul 2018
    Posts
    12

    How to have a field auto populate current date time based on a different Yes/No Field

    I have a form with Yes/No fields. What I need to happen is with the YES/No field is marked I need the field next to it to store the current Date and Time. I can make this happen but when the form is closed and opened again it updates the Date and Time in the Field. I need the Date and time not to change each time the form is opened. This is tracking a the time and action happened. This is the formula I have. Please help.



    The formula is in the Form On Current area.

    If Me("Tracker Returned 1") = True Then
    Me("Tracker Return Time 1") = Time
    End If

  2. #2
    donnie.atchison is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jul 2018
    Posts
    12
    Correction the formula is the following.

    If Me("Tracker Returned 1") = True Then
    Me("Tracker Return Time 1") = Now()
    End If

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'd use the after update event of the checkbox. That way it only fires when you change the value.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    By the way, you may want to add an Else clause to wipe out the date if the value is set to False.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    donnie.atchison is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jul 2018
    Posts
    12
    I put the above formula in the box after update but it would not work. any ideas.

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Error? Wrong result? Can you attach the db here?
    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. Replies: 4
    Last Post: 09-11-2017, 08:42 AM
  2. Replies: 13
    Last Post: 06-15-2017, 09:21 AM
  3. Replies: 2
    Last Post: 07-07-2014, 09:19 AM
  4. Replies: 7
    Last Post: 11-28-2012, 01:41 PM
  5. Replies: 3
    Last Post: 10-03-2011, 02:33 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