Making a timer

  • Thread starter Thread starter Jonathan
  • Start date Start date
J

Jonathan

I am a necomer to Access and I am creating a survey form
to be used by multiple users. I want to create a toggle
switch that will start/stop a timer so that the user
starts the timer when they begin the survey and stops the
timer when done. The elapsed time would be stored in a
field in the main table. Can this be done? Is it simple?
Or should I forget the whole thing and find another
solution.

Jonathan
 
Jonathan said:
I am a necomer to Access and I am creating a survey form
to be used by multiple users. I want to create a toggle
switch that will start/stop a timer so that the user
starts the timer when they begin the survey and stops the
timer when done. The elapsed time would be stored in a
field in the main table. Can this be done? Is it simple?
Or should I forget the whole thing and find another
solution.

Jonathan

If you don't need a running display of the elapsed time, all you really
need to do is record the start time (actually the start "moment" -- use
the Now() function to return this) when the toggle button's value is set
to True, and record the stop time when the button's value is set to
False. It's not clear to me from your description whether the user will
be starting and stopping this timer multiple times, in which case you
really do need a field for elapsed time, which you would add to each
time the timer is stopped. If the timer can be started and stopped by
each user only once, on the other hand, then you could just as easily
store the start time in one field and the stop time in another, and
leave the calculation of elapsed time to the query that will be
reporting the results.

Given a start time and a stop time, you can get the difference between
them in hours, minutes, or seconds using the DateDiff function, and use
a simple formula involving the \ and Mod operators to display that in a
more natural format.
 
Back
Top