By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,988 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,988 IT Pros & Developers. It's quick & easy.

Stop results reseting

P: 153
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_Click()
Lblsunsubtotal.Caption = Format((DTPickersunend.Value - DTPickersunstart.Value), "hh:nn")
lblmonsubtotal.Caption = Format((DTPickermonend.Value - DTPickermonstart.Value), "hh:nn")
lbltuessubtotal.Caption = Format((DTPickertuesend.Value - DTPickertuesstart.Value), "hh:nn")
lblwedssubtotal.Caption = Format((DTPickerwedsend.Value - DTPickerwedsstart.Value), "hh:nn")
lblthurssubtotal.Caption = Format((DTPickerthursend.Value - DTPickerthursstart.Value), "hh:nn")
lblfrisubtotal.Caption = Format((DTPickerfriend.Value - DTPickerfristart.Value), "hh:nn")
lblsatsubtotal.Caption = Format((DTPickersatend.Value - DTPickersatstart.Value), "hh:nn")

lbltotal = Format((DTPickersunend.Value - DTPickersunstart.Value + DTPickermonend.Value - DTPickermonstart.Value + DTPickertuesend.Value - DTPickertuesstart.Value + DTPickerwedsend.Value - DTPickerwedsstart.Value + DTPickerthursend.Value - DTPickerthursstart.Value + DTPickerfriend.Value - DTPickerfristart.Value + DTPickersatend.Value - DTPickersatstart.Value), "hh:nn")
End Sub
Dec 1 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.