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

Use filter on 2 search criteria on a form 2

Status
Not open for further replies.

peini

Programmer
May 1, 2002
13
US
I've tried to search on the forums, but couldn't
find my answer.
I have a question
I know it's working on one criteria as follows

DoCmd.ApplyFilter , "DATE like #8/5/2002#"

Is it possible to use applyfilter on 2 search criteria?

Thanks

 
I think I got it
Simply add it to the filter string
such like

DoCmd.ApplyFilter , "DATE like #8/5/2002# AND PARTNUM = 'tryit'"

 
Use the "AND" word
DoCmd.ApplyFilter , "DATE like #8/5/2002# And somefield = someparameter"

you could also use "Between" on your dates using "AND"

DoCmd.ApplyFilter , "DATE Between #3/5/2002# And #8/5/2002#"



DougP, MCP
 
Thankyou peini and Dougp, this is exactly the question I was looking for. I thought I tried Dougs method without success earlier but now it seems to be working. Here is the code I used.

It sure is nice that ApplyFilter will prompt the user for me.


DoCmd.ApplyFilter , "[date number] = [What Date Number?] and [run #] = [What small lot and Julian date?]"



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top