update record change date and time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have date and time fields for recood creation and record update in
Access 2000.
I have default values for my record creation date and time working fine
using =Date() and =Time().
How can I automatically update the date and time a record was changed on
a form?

Thanks.
T
 
I generally do this using the BeforeUpdate event of the form - assuming you
have controls for your date and time fields:

me.LastModDate=date()
me.LastModTime=Time()

Note that you could just have a single date field which stores all of this
information - since the date datatype also includes time. Use the Now
function to pull date and time into the date field:

me.LastModified=now()
 
That's it.
I was using the AfterUpdate event instead of BeforeUpdate and now
realize why that would not work.

Thanks for the assist.
T
 
Back
Top