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

  • Thread starter Thread starter PieceOfWork
  • Start date Start date
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)?
 
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
 
Back
Top