Sum of all subreports Count(*)

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
 
A

Allen Browne

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) + ...
 
M

Marshall Barton

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top