Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summing Totals Between Subreport and Main

Status
Not open for further replies.

pcdaveh

Technical User
Sep 26, 2000
213
0
0
US
I have a main report with details of transactions. At the bottom of that report I have totals that are generated in the report. I have some code that will take the calculated totals in the report and dump them into a table. The next time I run this report for the next date range, I want to be able to take the values that I dumped into that table and use them as the opening balances for next period. So, I've created a sub report with the values in the table. Is there a way to sum something in the subreport to what is in the detail report?
 
Quick though,
If you use the correct reference to the field in your detail {Reports!your reportName![FieldName]}, you can use it in your SubReport.

I might be wrong
 
You want to put the sum of a field in a SubReport in a textbox on the MainReport is how I'm reading the question. If I'm wrong, please correct me. Here's a sample of how to sum a control name txtTotalQty in a SubReport object on the main report named rsubReturns.

[tt]=Sum([rsubReturns].[Report]![txtTotalQty])[/tt]

The trick is the referencing, the easiest way to find it out is to use the expression builder. Find the thing you want to work with in the expression builder and double-click it to see how Access refers to the object. In this case you're looking at a SubReport object in your MainForm called rsubReturns.

HTH Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top