Illustrate (Count) Records of Filter button

ECEK

Registered User.
Local time
Today, 22:50
Joined
Dec 19, 2012
Messages
717
My form has several filter "buttons".

What I am looking to do illustrate, underneath the button,how many records are pertaining to that particular filter so that it flags to the user that there are issues with those particular records.

I already have an OnCurrent as so :

Code:
Private Sub Form_Current()

Dim rst As Object
Set rst = Me.RecordsetClone
On Error Resume Next
rst.MoveLast
On Error GoTo 0
Me.Text701.Value = rst.RecordCount

End Sub

I guess I'm looking to count based on specific criteria.
For Example:

My field is called Status and there are three permutations:
Pending
Outstanding
Complete

I want to count how many reports are Outstanding and illustrate this below the button that filters all of the Outstanding reports. Same for Pending etc

Can anybody point me in the right direction?
As always: Your time is much appreciated.
 
Last edited:
Worked it out myself: Yay
OnCurrent

Me.PendingFilterCount = DCount("[ID]", "MyQueryBehindTheForm", "[Status] = 'Pending'")
 

Users who are viewing this thread

Back
Top Bottom