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
419 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 36

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

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…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

820 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