#Error when summing a subform in a form

spetty

New member
Local time
Yesterday, 21:05
Joined
Mar 10, 2009
Messages
2
I am working on a project for work and cannot seem to complete the last step. There is a subform (TimeCardHours) within my form (TimeCard) where the hours from a shift are broken down and separated in two columns (StandardHours) and (OvertimeHours). I have the two columns summed in my subform footer as Total Hours

=Sum([Standard Hours]+[Overtime Hours])

I have created a new text box in my form entitled Total Hours Worked using the expression

=[Time Card Hours].[Form]![Total Hours]

I am still getting the #Error message though. I am new to Access so any help would be appreciated!
Thank you

SP
 
Is the name of your SubFormControl TimeCardHours or [Time Card Hours]? You have used it both ways in your post.
 
spetty,

Have a look at the attached sample, it may help you find the error.

My advise (if you don't mind) is to name your controls as I have and do not use spaces in field names (when you create them in the table). Also name you forms e.g frmTimeCard and for subform I use sfrmTimeCardHours.

If you look at the data record source for the subform you will see that I have Added TotalHours: [Standtime]+[Overtime] in the query and not the subform.

Hope this helps.
 

Attachments

Thank you for your help. I have fixed the error and now everything is working great!:)
 

Users who are viewing this thread

Back
Top Bottom