any suggestions on how to do this?

D

djc

I need to track how long someone takes to do something. I will make a simple
form with a text box to enter an ItemNumber along with start and stop
buttons. The user will enter the item number and hit start.... do what they
do (process).... and then hit the stop button when they are done. I will
need to be able to report how long each item takes to process.

any suggestions? My initial thought is to just record timestamps (Now()) for
stopping and starting and then do the math. But before I did that I wanted
to hear some other thoughts.

thanks in advance.
 
M

Marshall Barton

djc said:
I need to track how long someone takes to do something. I will make a simple
form with a text box to enter an ItemNumber along with start and stop
buttons. The user will enter the item number and hit start.... do what they
do (process).... and then hit the stop button when they are done. I will
need to be able to report how long each item takes to process.

any suggestions? My initial thought is to just record timestamps (Now()) for
stopping and starting and then do the math. But before I did that I wanted
to hear some other thoughts.


That's the best way to approach this. Doing the math is
fairly easy, but maybe a little subtle. Use the DateDiff
function to get the elapsed time in the smallest units
you're interested in. For example, if you want it to the
minute, then
lngElapsed = DateDiff("n", dteStart, dteStop)
lngHours = lngElapsed \ 60
lngMinutes = lngElapsed Mod 60

It takes more of the same kind of stuff if you want days
and/or seconds too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top