MS Access - Sum datasheet subform field on main form (Tab)

Hello,

I currently have a form with two subforms that tracks time and expenses.  In the time subforms, I have a calculated field for Time Worked and in the Expense subform, I have a calculated field for mileage.  I want to sum both subforms on the main form (tab) so the employee can see a total for their hours worked and total expenses.  I have tried numerous expressions, etc to get the totals but none successful.  Could you take a look at the attached sample database and advise what I need to do to get the totals to display as opposed to the "#Error or #Name.  My last expressions are included.

Any help would be appreciated
Time-Expense-Database.accdb
TonyMannellaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
GozrehConnect With a Mentor Commented:
Delete the Text30 on the expense subform
0
 
GozrehCommented:
You can not sum with other unbound field

you should use in txtTotalRegHrs =Sum(IIf([TimeOut]>[Timein],[TimeOut]-[Timein],([TimeOut]+1)-[Timein])*24)

and by [Total Expenses] =Sum([ExpenseAmount]+([Mileage]*0.45))
Time-Expense-Database.accdb
0
 
TonyMannellaAuthor Commented:
Worked Perfectly on the time subform.  Thank you.  But still having trouble on the expense subform displaying the data - Any suggestions??
0
 
TonyMannellaAuthor Commented:
Yep - Thank you.  Once I deleted the Textbox, it gave me the desired result.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.