Hours Total (1 Viewer)

access7

Registered User.
Local time
Today, 01:58
Joined
Mar 15, 2011
Messages
172
Hello Everyone...

Can anyone help me to understand why I have got an error in my Total Hours Box??
It is meant to be a total of the decimilsed daily totals (in the smaller boxes)....

I have attached the db, if anyone can stop me from banging my head against the wall I will be more than grateful.... :)

Thanks x :)
 

Attachments

  • Time Checker.zip
    31.7 KB · Views: 84

thechazm

VBA, VB.net, C#, Java
Local time
Yesterday, 20:58
Joined
Mar 7, 2011
Messages
515
I think the problem you are having is that the other value's on the form are trying to be calculated at the same time that the total time is trying to pull data from them. You get a type mismatch error when you try to do this together.

I was able to make this work with a command button as a test and your code is fine. Just make a command button and put this code behind it:

Code:
Me.Total_Hours.ControlSource = "=Sum(Nz(" & Me.txtTotalMon.Value & ",0)+Nz(" & Me.txtTotalTues.Value & _
    ",0)+Nz(" & Me.txtTotalWed.Value & ",0)+Nz(" & Me.txtTotalThurs.Value & _
    ",0)+Nz(" & Me.txtTotalFri.Value & ",0)+Nz(" & Me.txtTotalSat.Value & _
    ",0)+Nz(" & Me.txtTotalSun.Value & ",0))"

I tried a few different events on the forms operation to try and get it to work but no luck there. I hope this helps a little.

TheChazm
 

Users who are viewing this thread

Top Bottom