Multiple Or Statements in WHERE Clause

chot

New member
Local time
Today, 08:16
Joined
Mar 22, 2011
Messages
5
I've got this DB that I'm trying to use one query to generate data based on a criteria. The problem is i've setup three forms, with listboxes, to view the data in different ways, but all the listboxes generate the same field output.

In order to make this work i've put three Or statements in the query SQL, but every time i try to run it it asks for one of the inputs. Then if I generate that input it asks for the one i just used....

WHERE (((tblData.[GROUP])=[Forms]![frmDtClient]![lstDetail] Or (tblData.[GROUP])=[Forms]![frmDtProNum]![lstProNum] Or (tblData.[GROUP])=[Forms]![frmDtPM]![lstPMNum]));

I really don't want to have to create three seperate query's and associated forms to make this work. Any Ideas....?
 
Sounds like you are trying to build a search form to display the results depending on what the user chooses.
Here is a link to a sample database that I use for my search forms.
The important part is how the where clause is built from the listboxes or combos after the user makes their choice.
http://www.allenbrowne.com/ser-62.html
 

Users who are viewing this thread

Back
Top Bottom