Sum of all subreports Count(*)

  • Thread starter Thread starter Kirstie Adam
  • Start date Start date
K

Kirstie Adam

Dear All,

I have an unbound report, which has 5 different subreports. Each subreport
has a field in the report footer which counts all records, it is called
"Total" (original, i know!) and is simply =Count(*).
How do i get the main report to show a field which sums the value of each of
these total fields?

Thanks,

Kirstie
 
The Control Source of the text box on the main report will contain something
like this:

=IIf([MySub1].[Report].[HasData], [MySub1].[Report]![Total], 0) +
IIf([MySub2].[Report].[HasData], [MySub2].[Report]![Total], 0) + ...
 
Kirstie Adam said:
I have an unbound report, which has 5 different subreports. Each subreport
has a field in the report footer which counts all records, it is called
"Total" (original, i know!) and is simply =Count(*).
How do i get the main report to show a field which sums the value of each of
these total fields?

Use a text box with an expression like:

=subreport1.Report.Total + subreport2.Report.Total + . . .

If there is a possibility that a subreport might not have
any records, you can deal with it by referring to the
subreport total this way:
IIf(subreportx.Report.HasData,subreportx.Report.Total,0)
 
Back
Top