Looking for help on timing within a function

  • Thread starter Thread starter WillN
  • Start date Start date
W

WillN

At the facility I work, our associates use a very basic access database to
sign out individual work orders on an interval of around every 12 minutes.
They have asked if it would be possible to put a timer on the front page of
the database to show how long they have been working on the current work
order, updating each time they sing out another order.

I am not very adept at access nor is the rest of our management staff. Is it
possible to add this function, so they can better keep time of their work
being done?
 
Use the Form Timer event. Here is an example of how it can be done. In this
example, there is a command button that resets the elapsed time, but you
could put it anywhere in your code that is appropriate. Set the form's Timer
Interval property to 1000 (1 second). Dim lngTimeCount at the module level.

Dim lngTimeCount As Long

Private Sub cmdResetTime_Click()
lngTimeCount = -1
Call Form_Timer
End Sub

Private Sub Form_Timer()
lngTimeCount = lngTimeCount + 1
Me.txtTimeDisplay = Format(lngTimeCount \ 3600, "00:") & _
Format((lngTimeCount - (lngTimeCount \ 3600) * 3600) \ 60, "00:") & _
Format(lngTimeCount Mod 60, "00")
End Sub
 
Thank you very much
Use the Form Timer event. Here is an example of how it can be done. In this
example, there is a command button that resets the elapsed time, but you
could put it anywhere in your code that is appropriate. Set the form's Timer
Interval property to 1000 (1 second). Dim lngTimeCount at the module level.

Dim lngTimeCount As Long

Private Sub cmdResetTime_Click()
lngTimeCount = -1
Call Form_Timer
End Sub

Private Sub Form_Timer()
lngTimeCount = lngTimeCount + 1
Me.txtTimeDisplay = Format(lngTimeCount \ 3600, "00:") & _
Format((lngTimeCount - (lngTimeCount \ 3600) * 3600) \ 60, "00:") & _
Format(lngTimeCount Mod 60, "00")
End Sub
At the facility I work, our associates use a very basic access database to
sign out individual work orders on an interval of around every 12 minutes.
[quoted text clipped - 5 lines]
possible to add this function, so they can better keep time of their work
being done?
 
Back
Top