esurfer
01-29-2002, 02:07 PM
This has got to be simple but I can't get it to work. I have a "Date_Modified" field that I want to be updated with the current date when I double click on the field in the form. (Not On Enter as my title suggests, my mistake) I added the expression =Date() to the text box Event "On Dbl Click" but that is not working. What am I doing wrong?
Thanks,
esurfer
[This message has been edited by esurfer (edited 01-29-2002).]
jwindon
01-29-2002, 02:22 PM
Are you wanting to capture the Modified Date when ANY changes are made to the data? Or simply do this double click thing?
Your answer is needed for me to specify which event to tell you to put the code on.
esurfer
01-29-2002, 03:02 PM
Actually, I hadn't realized the former was available. So perhaps if you could inform me on both ways, but my original query was just to insert the current date upon double clicking.
Thanks
esurfer
[This message has been edited by esurfer (edited 01-29-2002).]
jwindon
01-29-2002, 03:20 PM
OK.
Option 1: When record is modified
Put code on the BeforeUpdate event of the form.
Me.Mod_Date = date()
Option 2: Double Click
Put code on the OnDoubleClick event of the Mod_Date field.
Me.Mod_Date = date()
To put the code on, click the little build button next to that event on the properties. DO NOT type it right on the line next to the name of the event. Choose Code Builder and insert the code between the lines that show.
Let me know how it turns out.
esurfer
01-29-2002, 03:26 PM
Right on. Thank you!
esurfer
Pat Hartman
01-29-2002, 07:09 PM
Usually the Now() function is used for timestamping rather than Date() because it also logs the time of day.