Multiple searches in an "open" query

bknight
BronzeLounger
Posts: 1353
Joined: 08 Jul 2016, 18:53

Multiple searches in an "open" query

Post by bknight »

I've a query that has as "open" criteria, when I open it a message box opens and displays a message to enter a field. What I would like to do is to open more than one search and have tried stringing two, for now, with OR and AND. When I do this I get no matching records. For example I might try "mo" OR "sun" or "mo" AND "sun". Is there a way to do this?

Code: Select all

SELECT Sheet1.Symbol, Sheet1.Company, Sheet1.Dividend, Sheet1.[Pay date], Sheet1.[Ex Date], Sheet1.Announced, Sheet1.Recorded
FROM Sheet1
WHERE (((Sheet1.Symbol)=[Enter Symbol]))
ORDER BY Sheet1.[Pay date];

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Multiple searches in an "open" query

Post by HansV »

That won't work.
You'd have to create a form with text boxes to enter the criteria, and use VBA code to assemble the SQL.
It could become quite complicated - do you really need this?
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1353
Joined: 08 Jul 2016, 18:53

Re: Multiple searches in an "open" query

Post by bknight »

If it that complicated, then no I don't need it.