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!

Recording multiple Now() entries

Status
Not open for further replies.

migv1

Technical User
Apr 23, 2004
39
US
Greetings!

I have to record the times when data entry starts and when it ends. I tried using the Now() function to set the ObsStart value - works OK. However, when the ObsEnd value is set to Now() by the click event of the save button, the ObsStart value is reset to the same date/time value.

How can I lock the previously recorded Now() ObsStart value and prevent it from being updated at the end of data entry? Or am I using the wrong method?

Any help would be greatly appreciated.
 
Don't set the ControlSource property of ObsStart to the =Now()

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi, PH:

ObsStart is actually a text box on the form; ControlSource is the dteObsStart field in tblObservations.
I would like the appropriate Now() values to be written to the ObsStart and ObsEnd textboxes and saved in the dteObsStart and dteObsEnd fields of tblObservations when the record is saved.

BTW, I tried resetting ObsStart to OldValue , but since the record is not saved until the end, OldValue is always Null.
 
Set the ObsStart value in the Current event procedure of the form:
If Me.NewRecord Then Me!ObsStart = Now()
And set the ObsEnd value in the BeforeUpdate event procedure of the form

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top