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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass value from sub report to main report

Status
Not open for further replies.

jen1701

Programmer
Dec 20, 2003
57
US
Hi all,

I have a main report with 2 sub reports. Each sub report has summary of Total in the report footer. I would like to add the sub reports summary of total together and displayed in the main report footer. How to get the value pass from sub report to the main report?? Please Help! Thank you very much in advance.

Jen
 
Use an expression in your main report like:
=srptReportA.Report.txtTotal + srptReportB.Report.txtTotal

The references are to the Names of the subreport controls. If there is the potential that either subreport might not have records, then use:
=IIf(srptReportA.Report.HasData,srptReportA.Report.txtTotal,0) + IIf(srptReportB.Report.HasData,srptReportB.Report.txtTotal,0)

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Thanks Duane for the quick reply. I will try your suggestion. Thank you so much for the help.

Jen
 
Can this work to pull from one sub report to another subreport? I need to pull a total off each of three subreports, add them together and post them on a fourth sub report. It's actually the first Sub report in my report if the order makes a difference. I was able to pull them to the main report, but haven't found a way to get them on the sub report.
Ken

- If you are flammable and have legs, you are never blocking a fire exit.
Mitch Hedburg
 
I don't know how or if this would work. I would try to do everything possible to avoid a value on a subreport that depends on a value from another subreport. This is too "house of straws" for me.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
I actually fixed the problem I had that was making my solution not work. I pull the total to the main report and reference it from there. So far no problems.
Ken.

- If you are flammable and have legs, you are never blocking a fire exit.
Mitch Hedburg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top