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!

Want to remove filter automatically if filter removes all records 1

Status
Not open for further replies.

BFP

Technical User
May 18, 2000
52
US
Hi all.

I have a simple question: since my form blanks out if I run a filter and the filter removes all records, how do I prevent that from happening? Here is my code:

Code:
Private Sub btnApplyFilters_Click()
    DoCmd.ApplyFilter "Query by Parameter"
End Sub

Thanks in advanced,

BFP
 
Perhaps this ?
DoCmd.ApplyFilter "Query by Parameter"
If Me.CurrentRecord = 0 Then Me.FilterOn = False

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Worked like a charm...thanks PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top