Linking Combo Box value to a Query criteria

Quantarama

New member
Local time
Yesterday, 23:26
Joined
Nov 18, 2010
Messages
5
Hi everyone,

I had a question regarding changing the criteria in a query depending upon the option selected in a combo box(which lives in a form)

So basically, can we do a multiple IIf then function in the criteria row of a Query and what would be the syntax be like ?

At the moment I am having seperate Queries for each Combo box option..for instance for option A it is referring to a Query with a criteria A, and so on..will be ending up with 20+ queries like this !!

Many thanks
 
I understood the OP to simply want to change the criteria in a query depending on the response in a single Comb.

I'd probably think about having a raw SQL statement behind a button with a variable to insert the require criteria.
 
Mind you if it's simple text criteria You could have the text in a hidden column in the combo and simply pick it up in the query using;
Code:
Forms!FormName!ComboName.Column([B][COLOR="Red"]x[/COLOR][/B])
Where x represents the column holding the criteria.
 
This was what prompted my response:
I had a question regarding changing the criteria in a query depending upon the option selected in a combo box(which lives in a form)
Which I thought is related to:
At the moment I am having seperate Queries for each Combo box option..for instance for option A it is referring to a Query with a criteria A, and so on..will be ending up with 20+ queries like this !!
So I was like :eek: cascade 20 combos!!! I was just clarifying the situation.:D
 
This was what prompted my response:

Which I thought is related to:

So I was like :eek: cascade 20 combos!!! I was just clarifying the situation.:D
I can understand your consternation and find it totally understandable. It is interesting how two people can read exactly the same thing and come to completely different conclusions :D
 
The mind works in mysterious ways John, and so does the brain:cool:
 

Users who are viewing this thread

Back
Top Bottom