Total Records in Database in Report

  • Thread starter Thread starter Perry Kew
  • Start date Start date
P

Perry Kew

I am creating an Access database for my books.

I have created several reports based on queries. For
instance, one report displays all my Philosophy books and
another one displays all my computer books etc.

On a report based on a query, how can I get the total
number of books in my database? A text box that I have in
the report footer has =count(*) as its control source.
However, this just returns the number of philosophy books
and not all books. Any way that I can return the total
number of books in the database in the report footer?

--Perry
 
Perry,

one way...
=DCount("*","NameOfYourTable")

- Steve Schapel, Microsoft Access MVP
 
Sounds like your are asking for a piece of information
that is separate from the information contained in the
main report (i.e. your report has parameters, but you
want a total that doesn't have parameters.

The solution is to construct a separate query to
calculate the total number of books in the db and link it
to a sub-report. That sub-report can be included in the
main report's footer area, but with the linked fileds
properties left blank. It will always show the total
number of books regardless of the parameters set in the
main report.
 
It worked! Thank you.
-----Original Message-----
Hi Perry,

try:

=DCount("*","[YourTableName]")

hth

chas
-----Original Message-----
I am creating an Access database for my books.

I have created several reports based on queries. For
instance, one report displays all my Philosophy books and
another one displays all my computer books etc.

On a report based on a query, how can I get the total
number of books in my database? A text box that I have in
the report footer has =count(*) as its control source.
However, this just returns the number of philosophy books
and not all books. Any way that I can return the total
number of books in the database in the report footer?

--Perry

.
.
 
Back
Top