update record change date and time

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
 
S

Sandra Daigle

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()
 
G

Guest

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
 

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