get MS Access 2010 to stamp the actual date on a field created for this purpose

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • luisalbertopr
    New Member
    • Apr 2013
    • 3

    #1

    get MS Access 2010 to stamp the actual date on a field created for this purpose

    I have an Access 2010 database which I'm trying to get it automatically stamp the date when specific field is populated or modified.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Use the on change event of the control in the form to run VBA code that will update the time stamp field.

    Comment

    • luisalbertopr
      New Member
      • Apr 2013
      • 3

      #3
      Thank you Rabbit for your response. But, can you be more specific. I'm a newby. I tried some options but cannot get the expected results. Thank you, again.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        In that case, what you'll want to do is look into a VBA tutorial because I don't think there's any other way to do this without code. Once you have that foundational understanding, we can get into the specifics of this problem.

        Comment

        • luisalbertopr
          New Member
          • Apr 2013
          • 3

          #5
          Thank you Rabbit. That's what I'm doing right now. It seems to be a simple task, however maybe it does need to write some code in order to get what I want to perform.

          Comment

          • nico5038
            Recognized Expert Specialist
            • Nov 2006
            • 3080

            #6
            I would use the form's BeforeUpdate event like:
            Code:
            Private Sub Form_BeforeUpdate(Cancel As Integer)
            
            If Me.FieldName <> Me.FieldName.OldValue Then
               Me.LastUpdated = Now()
            End If
            
            End Sub
            For the BeforeInsert you could use a test for the field being filled (<> "") when you want the initial filling recorded too.

            The LastUpdated field can be placed hidden on the form.

            Nic;o)

            Comment

            Working...