I need some help. I would like to have a “Command Button” placed on an open form that when clicked will apply a filter that will only show underlying records that have a “Null” value in the [CompDate] field. Then when it is clicked, again it will remove the filter showing all the records in the database. I would also like the name on the button to change back and forth to "filter on, "filter off" if possible. The form being filtered is bound by a “Query.”
Is this possible to do with a command button and if so which Category and Action type do I use?
Is there another way?
I have tried everything I can think of with command buttons with many variations of the code below and nothing works!
Is this possible to do with a command button and if so which Category and Action type do I use?
Is there another way?
I have tried everything I can think of with command buttons with many variations of the code below and nothing works!
Code:
Private Sub command542FormFilter_Click()
If Me. command542FormFilter .Caption = "Filter On" Then
Me. command542FormFilter .Caption = "Filter Off"
Me.Filter = ""
Me.FilterOn = False
Else
Me. command542FormFilter .Caption = "Filter On"
Me.Filter = "QUSel_FilterForm_FO-QUsq-TA-000"
Me.FilterOn = True
End If
End Sub