Solved

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

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now