Total Records in Database in Report

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
 
S

Steve Schapel

Perry,

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

- Steve Schapel, Microsoft Access MVP
 
K

Keith

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.
 
P

Perry

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

.
.
 

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