Count number of records after filtering

G

Gerwin Ramaker

Hello,


Probably a question that's easy to answer but I have been searching for
hours now & it's driving me rather crazy: I have applied a filter to a form
and now I want to know how many records I have got as a result, or better, I
want to know if there are any records left - how do I do that?

Tried so far:

If Form.Recordset.Count = 0 Then ...
If Iserror(Form.RecordSet.Count) Then ...
If EOF(Recordset) Then ...

but that all does not work.


Thanks,
Gerwin
 
A

Allen Browne

Try:
If Me.Recordset.RecordCount = 0 Then MsgBox "All gone"

Immediately after a filter the full count may not be available, but it
should be at least 1 if there are any records.
 

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