Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date update on Save 1

Status
Not open for further replies.

katiekat

Technical User
Jun 6, 2000
300
US
Hi there All,

I would like to capture the date on updates on a form. I'd like to automatically update the date when the user hits save, if they haven't already. I need some advice on what I should put where. I was thinking of a before update on the date field, then perhaps an onclick event....I was also thinking I could put an onchange event on all of the other fields on the form. I'm not sure what to do.

Thanks for your help!!

Kate Holy tek-tips batman!:-0
 
Well, I would put it on the Save Button's OnClick event. If you put it anywhere else then you run into a situation where a user may put something into a field then, return it to its original value. You'd be placing a value int the updated date field when the record is not updated.

Try this:

Private sub cmdSave_Click()

me!txtDateUpdate = Date()
docmd.runcommand accmdSave

end sub
The key is to set the update field before you do the saving.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top