I created a form to calculate sign in time, sign out time, and the elapsed duration.
Below is my code.
CAn anyone please tell me where i dont get it.
Sign in time is OK,Sign out time OK but the worked hrs is not..
Any Help???
Option Explicit
Dim signin As Variant
Dim signout As Variant
Dim worked As Variant
Dim today As Variant
Private Sub cmdsignin_Click()
signin = Now
lblreport.Caption = Format(report, "hh:mm:ss")
today = Now
lblreport.Caption = Format(today, "hh:mm:ss")
End Sub
Private Sub cmdsignout_Click()
signout = Now
lblleave.Caption = Format(leave, "HH:MM:SS")
today = Now
lblleave.Caption = Format(today, "Hh:mm:ss")
End Sub
Private Sub cmdworked_Click()
today = Now
signin = lblreport.Caption
signout = lblleave.Caption
worked = signout - signin
lblworked.Caption = Format(worked, "HH:MM:SS")
lblworked.Caption = Format(today, "hh:mm:ss")
lblreport.Caption = signin
lblleave.Caption = signout
End Sub
Fourty