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.
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.
Microsoft Access
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
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.