Hey everyone!
Does anyone know of a way to physically time how long it takes for someone
to complete a form? For example, as soon as they start entering text in the
first field, a timer (in the background - they don't have to see it) will
begin, tracking the amount of minutes it takes for them to get to the end of
the form and fill in the last field.
My assumption is that is can be done, but would require some coding. If so,
please let me know where to place that code. Thanks so much!
Joe
Graham Mandeno - 29 Apr 2008 22:44 GMT
Hi Joe
It depends on how accurate you want to be.
If you want to time to the nearest second, you can save the start time
(dtStart = Now) and then calculate the difference in seconds between that
and the finish time:
lSeconds = DateDiff("s", dtStart, Now)
If you want to measure with more precision (milliseconds) you can use the
Timer function with the same principle - save the start value and subtract
it from the finish value.
One caveat: the Timer function resets to 0 at midnight, so you might have to
allow for a special case that starts before and ends after midnight.

Signature
Good Luck :-)
Graham Mandeno [Access MVP]
Auckland, New Zealand
> Hey everyone!
>
[quoted text clipped - 11 lines]
>
> Joe
John W. Vinson - 29 Apr 2008 23:52 GMT
>Hey everyone!
>
[quoted text clipped - 8 lines]
>
>Joe
You could use an invisible unbound control, txtStarttime say, on the form, and
another (visible or invisible) control bound to the field in which you're
storing the time elapsed (let's call it txtElapsed and assume you want to
store the integer seconds, i.e. 390 would represent 6 1/2 minutes).
Put code in the Form's BeforeInsert event - which fires the instant a new
record is started:
Private Sub Form_BeforeInsert(Cancel as Integer)
Me.txtStarttime = Now
End Sub
Then in the form's BeforeUpdate event:
Private Sub Form_BeforeUpdate(Cancel as Integer)
<do any validation checking first>
<if the record passes validation then...>
Me.txtElapsed = DateDiff("s", Me.txtStartTime, Now)
End Sub

Signature
John W. Vinson [MVP]