Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

Trying sum in the report page footer

I have two subreports on a main report.  Each of them have a numberin a field in the report footer section of the subreport.

But then in the main report page footer I am trying to sum those two subreport values.    I can't get anything to show up in the field on the main report.

I've tried this but it doesn't work:

=[Reports]![subrptAuditIndexPageExterior]![txtSumExterior] + [Reports]![subrptAuditIndexPageInterior]![txtSumInterior]

???
ASKER CERTIFIED SOLUTION
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Agree with IrogSinta's comment.

Clarifying:

Assume reports mr, r1, r2
r1 has control fr1
r2 has control fr2
mr has control fmr
, control c1 which is a sub report control of Source object Report.r1
, control c2 which is a sub report control of Source object Report.r2
 
mr
       fmr
        c1
              r1: fr1
        c2
             r2:  fr2

Control source of fmr
= Reports!mr!c1.Report!fr1 + Reports!mr!c2.Report!fr2
or
= Report.c1!fr1 + Report.c2!fr2
or
= c1!fr1 + c2!fr2
or
= c1.Report!fr1 + c2.Report!fr2

The first reference is used as a complete path from Open reports collection.

If the setting is like:
mr
       fmr
        r1
              r1: fr1
        r2
             r2:  fr2
Where the sub report control name takes the name of its source object, then replace the c1 and c2 with r1 and r2 respectively in above code.