Count filtered records

  • Thread starter Thread starter Unnur U
  • Start date Start date
U

Unnur U

Is it possible to count filtered records when filtering by
VBA.

I have following code:

Private Sub cmbFilter_Click()
Me.Filter = "ID > 7000"
Me.FilterOn = True
End Sub

I need to display number of visible records in a Message
Box after pushing the button.

How can this be done?

Thanks
Unnur.
 
try this

msgbox = cmbFilter.listcount

Matt Weyland
Data Analyst
Stratis Health
(e-mail address removed)
 
This does not work since I am not counting within a
combobox or listbox.
Thanks Matt.
 
Unnur said:
Is it possible to count filtered records when filtering by
VBA.

I have following code:

Private Sub cmbFilter_Click()
Me.Filter = "ID > 7000"
Me.FilterOn = True
End Sub

I need to display number of visible records in a Message
Box after pushing the button.

Add code like:

With Me.RecordsetClone
If .RecordCount > 0 Then .MoveLast
lngRCnt = .RecordCount
End With
 
This was lovely.
Thank you Marsh
Unnur
-----Original Message-----


Add code like:

With Me.RecordsetClone
If .RecordCount > 0 Then .MoveLast
lngRCnt = .RecordCount
End With
 
Back
Top