I have a code that works fine up until it reaches 24 hours, then it resets. The form contains 2 dtpicker for each day, start and finish time. I want to calculate amount of hours worked. As I say if amount of hours worked is less than 24 then it displays great but it resets to 01:00 for 25 hurs.
Any help please I'd appreciate it
Private Sub CmdCalculate_Cl ick()
Lblsunsubtotal. Caption = Format((DTPicke rsunend.Value - DTPickersunstar t.Value), "hh:nn")
lblmonsubtotal. Caption = Format((DTPicke rmonend.Value - DTPickermonstar t.Value), "hh:nn")
lbltuessubtotal .Caption = Format((DTPicke rtuesend.Value - DTPickertuessta rt.Value), "hh:nn")
lblwedssubtotal .Caption = Format((DTPicke rwedsend.Value - DTPickerwedssta rt.Value), "hh:nn")
lblthurssubtota l.Caption = Format((DTPicke rthursend.Value - DTPickerthursst art.Value), "hh:nn")
lblfrisubtotal. Caption = Format((DTPicke rfriend.Value - DTPickerfristar t.Value), "hh:nn")
lblsatsubtotal. Caption = Format((DTPicke rsatend.Value - DTPickersatstar t.Value), "hh:nn")
lbltotal = Format((DTPicke rsunend.Value - DTPickersunstar t.Value + DTPickermonend. Value - DTPickermonstar t.Value + DTPickertuesend .Value - DTPickertuessta rt.Value + DTPickerwedsend .Value - DTPickerwedssta rt.Value + DTPickerthursen d.Value - DTPickerthursst art.Value + DTPickerfriend. Value - DTPickerfristar t.Value + DTPickersatend. Value - DTPickersatstar t.Value), "hh:nn")
End Sub
Any help please I'd appreciate it
Private Sub CmdCalculate_Cl ick()
Lblsunsubtotal. Caption = Format((DTPicke rsunend.Value - DTPickersunstar t.Value), "hh:nn")
lblmonsubtotal. Caption = Format((DTPicke rmonend.Value - DTPickermonstar t.Value), "hh:nn")
lbltuessubtotal .Caption = Format((DTPicke rtuesend.Value - DTPickertuessta rt.Value), "hh:nn")
lblwedssubtotal .Caption = Format((DTPicke rwedsend.Value - DTPickerwedssta rt.Value), "hh:nn")
lblthurssubtota l.Caption = Format((DTPicke rthursend.Value - DTPickerthursst art.Value), "hh:nn")
lblfrisubtotal. Caption = Format((DTPicke rfriend.Value - DTPickerfristar t.Value), "hh:nn")
lblsatsubtotal. Caption = Format((DTPicke rsatend.Value - DTPickersatstar t.Value), "hh:nn")
lbltotal = Format((DTPicke rsunend.Value - DTPickersunstar t.Value + DTPickermonend. Value - DTPickermonstar t.Value + DTPickertuesend .Value - DTPickertuessta rt.Value + DTPickerwedsend .Value - DTPickerwedssta rt.Value + DTPickerthursen d.Value - DTPickerthursst art.Value + DTPickerfriend. Value - DTPickerfristar t.Value + DTPickersatend. Value - DTPickersatstar t.Value), "hh:nn")
End Sub