How to display a filter

  • Thread starter Thread starter CY
  • Start date Start date
C

CY

I'm filtering records on a form with a button that invokes a query. Is
there any way I can show on the form what the records are being filtered
on??

For example, I have a field called "Active" - if it's a 1 it's active, and 2
it's inactive. Button invokes a query that only shows active records. I'd
like it to say somewhere on the form "Showing Active Records Only".

How do I do that?

TIA...
CY
 
cy,
put a label where you would like to see the message. After you name the
label, you can go to its property dialog, Format tab and delete the label's
caption.
In the code for the button that applies the filter, you put some code that
checks the value of active.
If Active = 1 then set the label's caption to "Showing Active Records Only",
and something appropriate if Active = 2.

Something like this code:

Private Sub cmdButtonName_Click()
'code here that applies the filter

If Me!Active = 1 Then
Me.TheLabelName.Caption = "Showing Active Records Only"
ElseIf Me!Active = 2 Then
Me.TheLabelName.Caption = "Showing InActive Records Only"
Else
Me.TheLabelName.Caption = ""
End If

End Sub


Jeanette Cunningham
 
Back
Top