Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to distinguish bet. Apply/Remove Filter with custom navigation...

Status
Not open for further replies.

MeisoT

Technical User
Apr 25, 2004
43
US
I am using custom navigation buttons and want to simulate the "(Filtered)" label that normally appears next to the navigation buttons when a filter is applied and disappears when the filter is removed.

When a user clicks the "Apply Filter" or "Filter By Selection" button, I can use the "Apply Filter" event to display the label as "(Filtered)". However, when the user clicks the "Remove Filter" button, the same event occurs and I cannot tell whether the user is applying or removing the filter.

How can I detect when the user removes the filter so that I can set the visible property of the label to false?

Any ideas?

p.s. - Access version = 2000

Thanks.

 
How are ya MeisoT . . . . .

When a filter is removed the [purple]ApplyType arguement[/purple] of the [blue]ApplyFilter event[/blue] is always a [purple]zero[/purple]. So try:
Code:
[blue]Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
   If ApplyType = 0 then
      Me!Label.Visible = False
   Else
      Me!Label.Visible = True
   End If

End Sub[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thanks AceMan,

it works great!!! I knew there had to be a way, I just didn't think to look for an event variable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top