Solved

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

Posted on 2014-01-29
4
1,436 Views
Last Modified: 2014-01-29
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
0
Comment
Question by:TonyMannella
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 10

Expert Comment

by:Gozreh
ID: 39817807
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
 

Author Comment

by:TonyMannella
ID: 39818275
Worked Perfectly on the time subform.  Thank you.  But still having trouble on the expense subform displaying the data - Any suggestions??
0
 
LVL 10

Accepted Solution

by:
Gozreh earned 500 total points
ID: 39818283
Delete the Text30 on the expense subform
0
 

Author Closing Comment

by:TonyMannella
ID: 39818847
Yep - Thank you.  Once I deleted the Textbox, it gave me the desired result.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question