Solved

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

Posted on 2014-01-29
4
1,443 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

Office 365 Training for Admins

Learn how to provision tenants, synchronize on-premise Active Directory, and implement Single Sign-On with these master level course.  Only from Platform Scholar

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
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.
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 …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

740 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