Number of records in subreport

S

Scott

I want to get in the main report footer the number of
records that were displayed by the subreport; I was able
to get the number of records in the subreport by adding a
text box to the subreport header with the ConrolSource
value of =Count([FieldName]), so that I'm able to see how
many records are displayed by the subreport at this time,
but since I have the subreport displayed more than 1000
times I want to see a bottom line of the records
displayed by the subreport.

Thanks

Scott
 
A

Allen Browne

Try adding a text box to the same section that contains the subreport, and
set these properties:
Control Source =[NameOfYourSubreportControlHere].[Report]![txtCount]
Running Sum Over All
Name txtCounter
Visible No

Then in the main report's Report Footer, place a text box with Control
Source of:
=[txtCounter]

The first (hidden) text box should collect the totals, and the last text box
should display it.
 
S

Scott

I tried doing so, but I'm getting the following display
on the main report footer text box:

#Error

when the Control Source of the first text box is set to =
[NameOfMySubreport].[Report]![txtCount]

And if I set the Control Source for the first text box to
=[NameOfMySubreport].[NameofMyMainReport]![txtCount]
then I'm getting the following display:

#Name


Please reply.

Thanks

Scott

-----Original Message-----
Try adding a text box to the same section that contains the subreport, and
set these properties:
Control Source =[NameOfYourSubreportControlHere]. [Report]![txtCount]
Running Sum Over All
Name txtCounter
Visible No

Then in the main report's Report Footer, place a text box with Control
Source of:
=[txtCounter]

The first (hidden) text box should collect the totals, and the last text box
should display it.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I want to get in the main report footer the number of
records that were displayed by the subreport; I was able
to get the number of records in the subreport by adding a
text box to the subreport header with the ConrolSource
value of =Count([FieldName]), so that I'm able to see how
many records are displayed by the subreport at this time,
but since I have the subreport displayed more than 1000
times I want to see a bottom line of the records
displayed by the subreport.

Thanks

Scott


.
 
A

Allen Browne

First, we are assuming you have a text box in the Report Footer section of
your subreport (not its Page Footer section), and that it has these
properties:
Control Source =Count("*")
Name txtCount
Format General Number
and that it correctly shows the number of records in the subreport.

Once that is working, open your main report in design view.
Right-click the edge of your subreport control, and choose Properties.
On the Other page of the Properties dialog, what is the Name property of
your subreport control?

The text box on your main report should have these properties:
Format General Number
Control Source =[xxxx].[Report]![txtCount]
where "xxxx" represents the name of the subreport control.

If the subreport has no records, you may see #Error. To prevent that, change
the Control Source of the main report's text box to:
=IIf([xxxx].[Report].[HasData], Nz([xxxx].[Report]![txtCount], 0), 0

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Scott said:
I tried doing so, but I'm getting the following display
on the main report footer text box:

#Error

when the Control Source of the first text box is set to =
[NameOfMySubreport].[Report]![txtCount]

And if I set the Control Source for the first text box to
=[NameOfMySubreport].[NameofMyMainReport]![txtCount]
then I'm getting the following display:

#Name


Please reply.

Thanks

Scott

-----Original Message-----
Try adding a text box to the same section that contains the subreport, and
set these properties:
Control Source =[NameOfYourSubreportControlHere]. [Report]![txtCount]
Running Sum Over All
Name txtCounter
Visible No

Then in the main report's Report Footer, place a text box with Control
Source of:
=[txtCounter]

The first (hidden) text box should collect the totals, and the last text box
should display it.


I want to get in the main report footer the number of
records that were displayed by the subreport; I was able
to get the number of records in the subreport by adding a
text box to the subreport header with the ConrolSource
value of =Count([FieldName]), so that I'm able to see how
many records are displayed by the subreport at this time,
but since I have the subreport displayed more than 1000
times I want to see a bottom line of the records
displayed by the subreport.

Thanks

Scott
 

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