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
414 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
ID: 39851462
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
ID: 39851470
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
ID: 39851547
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
ID: 39851595
This solution worked out perfectly for me.  Thank you!
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

895 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

18 Experts available now in Live!

Get 1:1 Help Now