Hi
I need to create "time tracker" for production. We have 4 working spots where workers produce different part for the same order.
1. Profile Cutting --->tblProfile
2. Fabric Cutting --->tblFabric
3. Montage --->tblMontage
4. Packing --->tblPacking
They need to track time through entire proccess on each spot.
I came up with the idea: make tables and forms for every action and add stopwatch. Then they can scan order number and save it (with time they spent on producing, name of the worker, current date).
I managed to create working login form. I found vba for stopwatch and it's working great:
Private Sub Form_Timer()
Dim lngNumOfHrs As Long
Dim lngNumOfMins As Long
Dim lngNumOfSecsRem As Long
lngNumOfSecs = lngNumOfSecs + 1
Select Case lngNumOfSecs
Case Is > 86400 '>1 day - not equipped for that
Case Is >= 3600 '>1 hour
lngNumOfHrs = lngNumOfSecs \ 3600
lngNumOfMins = ((lngNumOfSecs - (lngNumOfHrs * 3600)) \ 60)
lngNumOfSecsRem = lngNumOfSecs - ((lngNumOfHrs * 3600) + (lngNumOfMins * 60))
Case Is >= 60 '>1 minute
lngNumOfMins = ((lngNumOfSecs - (lngNumOfHrs * 3600)) \ 60)
lngNumOfSecsRem = lngNumOfSecs - ((lngNumOfHrs * 3600) + (lngNumOfMins * 60))
Case Is > 0 '< 1 minute
lngNumOfSecsRem = lngNumOfSecs - ((lngNumOfHrs * 3600) + (lngNumOfMins * 60))
Case Else 'shouldn't happen, but who knows?
End Select
Me![lblTime].Value = Format$(lngNumOfHrs, "00") & ":" & Format$(lngNumOfMins, "00") & _
":" & Format$(lngNumOfSecsRem, "00")
End Sub
But I need to have summary in another form. I tried something like this:
Private Sub Sum_Click()
Me.txtSum = Val(Me.time_tblProfile) + Val(Me.time_tblMontage) + Val(Me.time_tblFabric) + Val(Me.time_tblPacking)
End Sub
But it always return value "0".
I think this can be a problem with format of time 00:00:00 (hrs:min:sec)
Maybe someone could help me with this.
Thank you in advance!