Count the number of records a query returns

M

Mike

I want to count the number of records a query returns and
then display this number in a form.

Any ideas?

Thanks
mike
 
R

R

You might want to make a new query based on the same table for this, because
if you add it as a field in an existing query with other field displaying,
it won't count ALL the records.

In your new query, when you have all the tables in and joined as you need
them, select View/Totals and pull down the ID or some other field into the
grid. In the "Total" row, it probably says "Group by". Change it to say
"Count". Run the query ... see if that's what you're looking for.
 
F

Fredg

Mike,
Is the query the record source for the form?
If so how about an unbound control.
Set it's controlsource to
=Count(*)

If the query is not the form's record source, you can use a DCount
in an unbound control:
=DCount("*","QueryName")
 

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