How to reference a control on subreport for use in outer rpt

P

PieceOfWork

I have a subreport that calculates totals within a group (for ex. goals). How
do I grab the control to perform further calculations within the main report
that lists numbers completed to goal (for ex. goal minus achieved)?
 
A

Allen Browne

You can use an expression like this in the control source of a text box on
the main report:
=[Sub1].[Report].[Text0]
where Sub1 is the name of your subreport control, and Text0 is a text box in
the Report Footer section of the subreport.

This will show #Error if the subreport has no records, so you need to use:
=IIf([Sub1].[Report].[HasData], [Sub1].[Report].[Text0], 0)

Details in:
Bring the total from a subreport onto a main report
at:
http://allenbrowne.com/casu-18.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top