Al,
Why would you want the "creation" Date and Time to change just because someone opens
the form? That would mean that it really doesn't represent the Date and Time of Creation,
but only the last time the record was viewed.
Try this method...
Two fields in your table... DOC (DateofCreation) and DOLE (DateOfLastEdit)
In the forms Before Update event, place this code...
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(DOC) Then
DOC = Now()
Else
DOLE = Now()
End If
End Sub
When a new record is created, DOC gets set (Disable and Lock both fields from user
entry).
Later, when the record is revisited..., AND is "edited" at all, the DOLE will set.
I have a sample file (97 and 2003) on my website below, that demonstrates this (and a
field for records statistics too).
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions
"Find a job that you love, and you'll never work a day in your life."
AL Rios said:
I can created a date time when the file is created. But when a user opens
the form again the date time does not change. I have used the following code
in the events before, dirty and afterudpate but no joy..
me[Date_TimeModifeed] = Now()
This should include the time and only stamp the record when some other field
has been modified.
Al