Totalling Multiple Subreports

  • Thread starter Thread starter IreneJ
  • Start date Start date
I

IreneJ

Hello,

I have a Main Report with 3 or 4 subreports, they are all
linked on Date as I would like our staff to run a report
with information from all these places by date (or group
of dates). I have two challenges:

1) I have a Total Box on each subreport. In the Date
Footer I have a text box to add all the daily values
together i.e.
MainReportTotal+Subreport1Total+Subreport2Total+Subreport3
Total. That total brings all the values together fine
but I have another Grand Total Box in the Report Footer
for a Grand Total for groupings of days with the same
values in it, but it won't total both dates. I tried to
add a =Sum in front of it and it complains and gives me
an error message.
2) If any one of the reports does not have information in
it, I get #Error boxes all over the place where the
totals are.

Would anyone be able to help me with the totalling
problem and the #Error if the subreport is empty. And if
anyone is aware of a link that I could go to to see what
I'm doing wrong.

Thanks very much,
Irene
 
IreneJ said:
I have a Main Report with 3 or 4 subreports, they are all
linked on Date as I would like our staff to run a report
with information from all these places by date (or group
of dates). I have two challenges:

1) I have a Total Box on each subreport. In the Date
Footer I have a text box to add all the daily values
together i.e.
MainReportTotal+Subreport1Total+Subreport2Total+Subreport3
Total. That total brings all the values together fine
but I have another Grand Total Box in the Report Footer
for a Grand Total for groupings of days with the same
values in it, but it won't total both dates. I tried to
add a =Sum in front of it and it complains and gives me
an error message.
2) If any one of the reports does not have information in
it, I get #Error boxes all over the place where the
totals are.

Would anyone be able to help me with the totalling
problem and the #Error if the subreport is empty.


1. Add a text box named txtRunTotal to the date footer.
Set its expression to =nameoftextboxwithtotalofsubreports
and set its RunningSum property to Over All. Then the text
box in the report footer can display the grand total by
using the expression =txtRunTotal

2. Change the text box's expression to:
=MainReportTotal +
IIf(subreport1.HasData, subreport1.Subreport1Total, 0) +
IIf(subreport2.HasData, subreport2.Subreport2Total, 0) +
IIf(subreport3.HasData, subreport3.Subreport3Total, 0)
 
Back
Top