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

Mutiple parameter query - no scope? 1

Status
Not open for further replies.

bikerted

Technical User
Nov 7, 2003
221
GB
I've posted this one before in a rather complicated format, and in the forms forum, so those who may have viewed it forgive me if I'm repeating myself. Hopefully this is clearer:

I have a continuous form designed to have several combo boxes (call them cbo1 to cbo14 for the sake of argument)and it's source query with form fields - f1 to f14 - from which I have reference back to the corresponding combo boxes:

e.g. [Forms]![MyFormName]![cbo1]

After putting in an advised expression I have this as my query column heading:

[Forms]![MyFormName]![f1]

On the next query line is the IsNull expression.

If I continue with this query, adding more fields and refs to cbo's there will not be enough lines for all the OR situations!

To make this work for my very good friend the end user, and make her life much easier, I need to be able to select any of the fields - in any combination - in order to display the form with the selected records. So cbo1 and cbo3, when selected (leaving the other cbo's alone), will select and display on MyForm - a two (or however many) stage filter if you like. I just can't see how to set the query up, not being SQL literate - though it is becoming clearer!.

Any help to solve this one would be greatly appreciated.

Ted.
 
if you mean within the query builder there are not enough lines in the criteria for you to put all of you queries.

The simple solution to achieve this is to edit the sql so that it displays more lines then you need.

create a new blank table - call it table1 - then within this table create some field call them 1 - 15

then create a new query and paste the following code into the sqp design

Code:
SELECT Table1.[1], Table1.[2], Table1.[3], Table1.[4], Table1.[5], Table1.[6], Table1.[7], Table1.[8], Table1.[9], Table1.[10], Table1.[11], Table1.[12], Table1.[13], Table1.[14], Table1.[15]
FROM Table1
WHERE (((Table1.[1])="1")) OR (((Table1.[2])="1")) OR (((Table1.[3])="1")) OR (((Table1.[4])="1")) OR (((Table1.[5])="1")) OR (((Table1.[6])="1")) OR (((Table1.[7])="1")) OR (((Table1.[8])="1")) OR (((Table1.[9])="1")) OR (((Table1.[10])="1")) OR (((Table1.[11])="1")) OR (((Table1.[12])="1")) OR (((Table1.[13])="1")) OR (((Table1.[14])="1")) OR (((Table1.[15])="1"));

once you have done this then transfer the query you require more line to this one - the easiest way to do this is to insert the table/queries first, do all your links etc, then go into the query you need then copy the column, and then paste them into the new one, then delete table1, then add the extra lines you need.

I hope this helps....
 
Thank you,

I'm not sure I'm approaching this problem correctly, because I still need to combine the filtering of each combo. Perhasp there is a better way?

Nevertheless, I'll give it a try.

Mnay thanks for your trouble.

Ted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top