Solved

Trying to sum the value of a number field on a main report and the value of a number field on a subreport

Posted on 2014-02-11
4
413 Views
Last Modified: 2014-02-11
I'm rrying to sum the value of a number field on a main report and the value of a number field on a subreport that is in the main report.

Here is what I have but it doesn't work:

=[txtRegHrs]+[Reports]![subrptTimeCardDataEntryCostCtrsGrp3Payroll]![txtRegHrs]
0
Comment
Question by:SteveL13
  • 2
4 Comments
 
LVL 14

Expert Comment

by:Bill Ross
Comment Utility
Hi,

Place the controls in the report footer and subreport footer

=Sum(txtRegHrs])   <-Sub Report name control txtTotalSub

=Sum(txtRegHrs])  + [subrptTimeCardDataEntryCostCtrsGrp3Payroll].report!txtTotalSub  <-Main Report  name control txtTotalMain

note that [subrptTimeCardDataEntryCostCtrsGrp3Payroll] is the name of the control holding the subreport not the name of the subreport although they can be the same.

regards,

Bill
0
 
LVL 34

Accepted Solution

by:
PatHartman earned 500 total points
Comment Utility
Since a subreport can have multiple rows, exactly which row did you want to reference?

What I would do is create a totals query that sums to the level I need.  Then since this is a report, I can change my RecordSource query to join to the totals query which will let me bind a column to the total.  Then my expression would be

=Nz(txtRegHrs,0) + Nz(SumRegHrs,0)
0
 

Author Comment

by:SteveL13
Comment Utility
I'm trying to reference this in the field in the footer of the main report...

txtGroupRegHrsTotal

and in the subreport I'm trying to reference this in the footer of the sub-report...

txtCostCtrGroupRegHrsTotal

Here is what I have but still not working.

=Sum([txtGroupRegHrsTotal]+[subrptTimeCardDataEntryCostCtrsGrp3Payroll].[Report]![txtCostCtrGroupRegHrsTotal])
0
 

Author Closing Comment

by:SteveL13
Comment Utility
This solution worked out perfectly for me.  Thank you!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

772 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

9 Experts available now in Live!

Get 1:1 Help Now