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

using dbs.CreateQueryDef with multiple criteria

Status
Not open for further replies.

Wrathchild

Technical User
Aug 24, 2001
303
US
Hi, I'm creating a query on the fly in code and I'm stuck on how to put multiple criteria on a field. I'm asking for field results of "BA" or "BB" but everything I've tried it just returns "BA or BB" as the criteria, which of course won't work. How do I separate them?
 
Try something like this:


Tick = Chr(34)

x = Tick + "BA" + Tick + " or " + Tick + "BB" + Tick

MsgBox x

CharlesCook.com
ADP - PeopleSoft
ReportSmith - Crystal Reports - SQR - Query
Reporting - Interfaces - Data Mining
 
thanks! that did it; I was so close - I was using quote = """" instead of tick...guess I had one too many "

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top