How to display a filter

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
 
J

Jeanette Cunningham

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top