Results 1 to 4 of 4
  1. #1
    Eric2013 is offline Novice
    Windows 8 Access 2013
    Join Date
    Mar 2013
    Posts
    14

    After Update / Populate current date

    I'm a bit lost on this one. been following threads, trying to get this simple Event procedure to work.

    i have a form with a field i'd like to put in an updated date each time the form has any kind of data added to it, or removed.

    I created an Event procedure for my field "autoupdate" used ;

    Private Sub AutoUpdate_AfterUpdate()
    Me!AutoUpdate = Now()
    End Sub

    didnt work, tried the below

    Private Sub AutoUpdate_AfterUpdate()
    Me.AutoUpdate = Now()
    End Sub

    it didn't work, saved it, closed out, opened again, to that form, made adjustment, but no date populate.

    did the google search for form changes and date poplulate, even got a book on access 2013 the missing manual, professional access 2013 as well.



    I will have more then one person using this form on a network and it would be nice to know for inventory tracking purposes, when it was updated. at this point in time, it's a standalone on one machine. tried this on 2 different computers, and still no date on update.

    Can someone point me in the right direction please...and thanks in advance.

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Place your current code in the Form_BeforeUpdate event. To populate the AutoUpdate Field when the Record is first created and any time it is edited:

    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
     Me.AutoUpdate = Now()
    End Sub

    To only update the Field when the Record is edited:

    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
     If Not Me.NewRecord Then 
      Me.AutoUpdate = Now()
     End If
    End Sub

    BTW: Now () will give you a date and time component. For date only, replace Now() with Date().

    Linq ;0)>

  3. #3
    Eric2013 is offline Novice
    Windows 8 Access 2013
    Join Date
    Mar 2013
    Posts
    14
    Tks Linq. That worked perfect.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Glad we could help!

    Good luck with your project!

    Linq ;0)>

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

Similar Threads

  1. Replies: 14
    Last Post: 08-12-2014, 06:33 AM
  2. Replies: 2
    Last Post: 07-07-2014, 09:19 AM
  3. Populate form with current record
    By drew17 in forum Forms
    Replies: 1
    Last Post: 06-30-2014, 11:23 AM
  4. Replies: 7
    Last Post: 11-01-2013, 03:17 PM
  5. Check dosent update current date
    By bsunuwar in forum Access
    Replies: 10
    Last Post: 03-23-2011, 09:46 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