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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form filter button on form

Status
Not open for further replies.

dkape

MIS
Mar 22, 2001
17
0
0
US
Is it possible to put the apply for filter button ( the hour glass button, which is on the menu bar) on a form?
 
Yes,

To replicate that button's functionality you just need to create a macro with "ApplyFilter" as the command line. Or if you're comfortable at all with VBA then just use this code on the "OnClick" of your button:

Private Sub ButtonNameHere_Click()
DoCmd.ApplyFilter "[FieldName] = 'x'"
End Sub

If you give me some more details as to how you want to filter, I can be more specific...

Hope this helps, Kyle [pc2]
 
Thanks, for the reply. What I actually want to do is give the user a way to un-apply a filter, and show all records.
 
OK, well that's just as easy, just chage the code to this:

Private Sub ButtonNameHere_Click()
Me.FilterOn = False
End Sub Kyle [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top