Results 1 to 6 of 6
  1. #1
    jo15765's Avatar
    jo15765 is offline Expert
    Windows XP Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672

    Update a field in table based on tickbox on form

    I have a tickbox on my form, it is unticked by default. If this tickbox is ticked, I want it to update a field in the table with todays date. How would I go about accomplishing this?



    EDIT ---
    Maybe it will make sense if I elaborate more. I have a tickbox for "Ordered" if it is checked then the part has been ordered, if it has not been checked of course the part has not been ordered. What I am wanting to do is update Date_Ordered with the date that the tickbox for Ordered was checked.

  2. #2
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Try the coding below to the AfterUpdate for the tickbox.

    Code:
    If Me!Ordered = True Then
    Me.Date_Ordered = "Date()"
    Else
    Me.Date_Ordered = ""
    End If
    If it enters Date() into the field or returns an error, remove the "" from around Date().
    Last edited by TG_W; 04-24-2012 at 02:08 PM. Reason: Further clarification

  3. #3
    jo15765's Avatar
    jo15765 is offline Expert
    Windows XP Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    I just needed to use Date(). Thank you! One other question...We add the part to the database when we find out it needs to be ordered (but not yet ordered) and then we just click the arrow at the bottom of the form to add the record. Is there a way to capture the Date() it was added?

  4. #4
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Set Default Value of the field to Date(). That should do the trick.

  5. #5
    jo15765's Avatar
    jo15765 is offline Expert
    Windows XP Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    That got it again! Thank you for the prompt responses

  6. #6
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    You're welcome. Glad I could help.

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

Similar Threads

  1. Replies: 7
    Last Post: 11-24-2014, 02:11 PM
  2. Replies: 1
    Last Post: 08-31-2011, 04:03 PM
  3. Replies: 4
    Last Post: 04-18-2011, 07:18 AM
  4. Replies: 3
    Last Post: 01-17-2011, 01:48 AM
  5. Replies: 4
    Last Post: 09-03-2009, 02:01 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