Include number of records found in report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report which is based on a query.

I want to include in the report the number of record found. Is it possible
to do this?

Thanks for any help.
Seth
 
Set an unbound text box to =DCount("Myfield", "myquery")
Myfield is any valid fieldname in the query, myquery is the query name.

UpRider
 
I have a report which is based on a query.

I want to include in the report the number of record found. Is it possible
to do this?

Thanks for any help.
Seth

In the report, add an unbound control.
Set it's control source to:
=Count(*)
 
I have entered
=Count(*)
in the control source of an unbound text box but the text box dispalys
#Error

Do I need to specify what to count and where to count it?

Thanks,
Seth
 
You can add a text box to the detail of the report, make it equal to 1
(ControlSource = 1), and define it a running sum.
make the field invisible, and on the buttom of the report you can add a
field, that is bound to the name of the field you created above.
 
is your unbound textbox in the report's footer section? if yes, then try
replacing the asterisk (*) with the name of a valid field in the report's
RecordSource (i usually use the primary key field), as

=Count([MyField])

hth
 
I have entered
=Count(*)
in the control source of an unbound text box but the text box dispalys
#Error

Do I need to specify what to count and where to count it?

Thanks,
Seth

No. Just write it exactly as I gave it to you.
=Count(*)
Make sure the name of this control is NOT "Count".
Do NOT place this control in the Page Footer or the Page Header.
Place it any where else.

If you do need this count shown in the page footer, place this control
somewhere else. Then add an another unbound control to the Page Footer
or Header.
Set it's control source to:
=[Name of the control mentioned above]
 
fredg said:
No. Just write it exactly as I gave it to you.
=Count(*)
Make sure the name of this control is NOT "Count".
Do NOT place this control in the Page Footer or the Page Header.
Place it any where else.

Doesn't it *have* to be in the Report Header or Footer is he wants the total
count? For example, in the Details section won't it always display 1 and in
a group footer it would only return the count for each group?
 
Doesn't it *have* to be in the Report Header or Footer is he wants the total
count? For example, in the Details section won't it always display 1 and in
a group footer it would only return the count for each group?

Actually it does work as indicated in the Detail Section. As a test,
I just placed the =Count(*) control in the detail section of a report
and it did show the total number of records in the report.
I then moved the control to a group header, and as you state, it did
show just the count for the group.
So we each get 1 point! :-)
 
Back
Top