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

ApplyFilter - Apply Multiple Filters? 1

Status
Not open for further replies.

zenenigma

Programmer
Apr 23, 2001
119
US
I have a large table that many people use to view their cases. I currently have a button that when pressed - will prompt the user for the first name of the user who's cases you want to search for. This works fine:

Code:
docmd.applyfilter, "emp_first_name = [Enter Investigator First Name]"

The problem is, I also want the user to be able to state if they want to view "open" or "closed" cases:

Code:
"[Case Status] = [Case Status (Open or Closed)]"

However, I haven't been able to find a way to include both filters. When I combine them like this:

Code:
DoCmd.ApplyFilter , "emp_first_name = [Enter Investigator First Name]" And "[Case Status] = [Case Status (Open or Closed)]"

I get a type mismatch.

Doing one ApplyFilter and then another immediately afterwards results in only the 2nd filter being applied.

Any help would be appreciated.
 
And this ?
DoCmd.ApplyFilter , "emp_first_name = [Enter Investigator First Name] And [Case Status] = [Case Status (Open or Closed)]"


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV, I should have known the quotes would be the death of me. Thanks so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top