Count filtered records

G

Guest

Is there a way to determine the count of displayed records after a filter has
been applied to a form? This would be the number displayed at the bottom of
the form if the Navigation Buttons property is set to Yes.

Thanks in advance,
 
A

Allen Browne

You could determine the count of records with this expression:
=[Form].[RecorsetClone].[RecordCount]

However, be aware that this shows the number of records Access has loaded
into the form. When you first load/filter the form, it grabs the first
record and shows it in screen, so the count will probably be 1. Eventually
the number gets updated. Or you can force the update in code by moving the
the last record:
With Me.RecorsetClone
If .RecordCount > 0 Then
.MoveLast
End If
End With
 

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