Start & End Time - Please Help

Dopeyjh

Registered User.
Local time
Today, 18:23
Joined
Aug 24, 2007
Messages
24
Hi....
In my form I would like to create a command button, that when clicked on, will enter the date & time into another field. As well as the same for end time.

I would like to automate this feature as much as possible to eliminate user manipulation when the database is completed.

Essentially what i am trying to determine is how long a process takes to complete.

Does anyone have any other ideas, other than the user manually entering the date and time?. Please help.

Thanks.
 
Look at the Now(), Date() and Time() functions.
 
Using the above, in the buttons on click event select event procedure and enter textbox1 = Date or Now or anything else. You can use one button for start and another for end, or be really clever and use the same button for both, e.g. If IsNull(box1) Then box1 = Now Else box2 = Now
 
Thanks..

This is what i typed.

Private Sub Command244_Click()

timesstart = Time()

End Sub


and its not working...Any ideas what i am doing wrong? Timestart is the name of the field that i want the time populated in.
 
Is timesstart the name of a textbox or something else?

Chris B
 
Timestart is the name of the textbox field that i want the command button to populate the time in.
Thanks
Jen
 
textbox field
That's two different things. The textbox is the control and the field is what the control is bound to. If you have used the Form Wizard, Access has the annoying feature of using the field name as the textbox name and that causes problems. Change the name of the control to txtTimestart and change the VBA to
Me.txtTimestart= Now()
 
Agree. At the top of the All tab of the textbox, the name must be timesstart not the control source which is the next line down. This should be blank. The function
Private Sub Command17_Click()
timesstart = Time()
End Sub
works fine for me against a textbox named timesstart.

Chris B
 

Users who are viewing this thread

Back
Top Bottom