Count the number of records in a form?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have form which I may or may not have applied a filter on.
In a code related to the form, I need to know how many records are available
currently in the form (after any filtering).
How do I do this?
 
Check the RecordCount of the form's RecordsetClone.

The count reflects the number of records loaded so far, so you need to
MoveLast to get an accurate count:

With Me.RecordsetClone
.MoveLast
MsgBox .RecordCount & " record(s)."
End With
 
Back
Top