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

Filtering data using multiple conditions

Status
Not open for further replies.
Jan 30, 2002
23
US
I am new to coding in Access. I am trying to filter certain records to my main form. I think that it is simply my syntax that is wrong. Basically what I want is to filter all data for condition3 when condition1 or condition2 are true.

Forms!Main.Filter = strCondition3 & (strCondition1 Or strCondition2)

Thanks much!
Travlnbard
 
Something like this ?
Forms!Main.Filter = strCondition3 & " AND (" & strCondition1 & " Or " & strCondition2 & ")"


Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
It turns out that I have other issues with my code but I think that is going to work once I get the conditions in order.

PHV,
Why did you put the & before and after the variables? Sorry if this is a dumb question but I am very new to VBA.

Thanks,
Cathy
 
You have to understand the difference between a string variable and a literal constant.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top