Modified Date Field

J

Jason

I'm trying to create a field on a form the shows the date.
i would like this date to automatically put the current
date in if any information changes in the entire record -
like a "last modified date".

Can this be done easily?

Thnaks for your help in advance
 
A

Al Camp

Jason,
I usually use 2 small date fields in the upper left corner of each form.
DOC (DateOfCreation) and DOLE (Date of Last Edit)
Then this code...
Private Sub Form_BeforeUpdate(Cancel As Integer)
If (IsNull(DOC)) Then
DOC = Date
DOLE = Date
Else
DOLE = Date
End If
End Sub

hth
Al Camp
 
G

Guest

does this not change the DOLE entry even if you cycle
through the records and don't actually change anything?
 
A

Al Camp

No, because cycling through records does not update any fields... hence...
no BeforeUpdate event.
Only when you return to a previous record, and change a value, will DOLE be
updated.
Al Camp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top