Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-01-29
4
Medium Priority
?
1,523 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 2000 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

730 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