Counting a Filtered Recordset VBA

Neilster

Registered User.
Local time
Today, 15:55
Joined
Jan 19, 2014
Messages
218
Hi Guys

I have this code below and works ok with a lable box, however is won't show filtered recordset. I know its something to do with Me.lblRecoredCount.Value = DCount("StaffID", "tblStaff", strFilter) but I just can't seem to get the correct end resault.

Private Sub Form_Current()

If Me.NewRecord Then
Me.lblRecordCount.Caption = "New Record"
Else
Me.lblRecordCount.Caption = _
"Record " & Me.CurrentRecord & " of " & Me.RecordsetClone.RecordCount
End If

Thanks for any help :D
 
at the bottom of the form, (form footer)
add another field (any that exist)
in the formula of the field put: =count([field])

this will show the count filtered or not.
 
Hi thanks,

However I was hoping to add to the existing code as that code shows record of record.
 

Users who are viewing this thread

Back
Top Bottom