START AND STOP TIME ENTRY

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form in which I wish to automatically capture a start time and the
actual stop time of an entry. I have tried several different approaches but
cannot get the stop time accruate without manual entry. Ideally I'd like to
stop time when the record is closed or a new record opened - there will be
multiple users. Any ideas?
 
Jim,

Would the Before Update event of the form do the job? Or the After
Update event?
 
In your form's module, put this declaration to the top (just under Option
Compare Database)

Private Declare Function WWindowsStart Lib "WINMM" Alias _
"timeGetTime" () As Long
Dim lngTimeStart As Long
Dim lngTimeStop As Long


In the form's Current event, put:

lngTimeStart = WWindowsStart

In the form's BeforeUpdate event, put:

lngTimeEnd = WWindowsStart
Me.MyTextBox = lngTimeStop - lngTimeStart

Where MyTextBox is the name of the textbox you want to store the value in.
The value returned is in milliseconds.
 
Back
Top