Counting Records on a Form (short)

  • Thread starter Thread starter Andy Korth
  • Start date Start date
A

Andy Korth

This should be a short one...
I've got one of those fancy continous forms. In the
header, I'd really like a little text box that says:
"Now viewing 10 records."
Actually, I'd like it to just say 10- when there are 10
rows showing in my form, of course.

Anyway, the obvious solution here is DCount. However, it
doesn't seem to work having DCount in the control source
of a textbox. Any ideas?
The recordsource is a pretty long SQL string, with a
WHERE clause in it, so that needs to be in the DCount, if
that is the route to take.

Thanks a lot,
Andy
 
Andy Korth said:
This should be a short one...
I've got one of those fancy continous forms. In the
header, I'd really like a little text box that says:
"Now viewing 10 records."
Actually, I'd like it to just say 10- when there are 10
rows showing in my form, of course.

Anyway, the obvious solution here is DCount. However, it
doesn't seem to work having DCount in the control source
of a textbox. Any ideas?
The recordsource is a pretty long SQL string, with a
WHERE clause in it, so that needs to be in the DCount, if
that is the route to take.

You *could* use DCount, if you set it up properly, but it's probably
simpler to use this as the controlsource for your text box:

=Count(*)
 
Ha, perfect! Thanks a lot.
Count... works even better than DCount. Wonder how I
missed that one.

:D
Andy
 
Back
Top