Enter date for only records that change

amerifax

Registered User.
Local time
Today, 09:57
Joined
Apr 9, 2007
Messages
304
We have a field that should get the current date only if record is changed. The date field is called "change".

We tried the following in Field Properties - After UpDate. No go.
2010Master![change]=Date()

2010Master![change]=Date()

I would think it would be some kind of an event.

Bob
 
Try

If Me.Dirty = True then
Me.change = Date()
Me.Dirty = False
end if
 
Put it in the form's BEFORE UPDATE (it only fires if it is a new record or something has changed) event. And you can check to see if it is a new record if you don't want it to be put in there for that:

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
   If Not Me.NewRecord Then
      Me!Change = Date
   End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom