Query from Data in Combo Box

chabbir

New member
Local time
Today, 13:37
Joined
Oct 21, 2009
Messages
7
Hi,

After searching in many posts under the queries I am not able to get the solution to my problem. Here is what i intend to do:

I have created a form with an unbound Combo Box which picks its value from a list. I want to use the selection in the list as a parameter for retrieving data from an existing query. Whenever I am running the query its giving no data.

Following is the code:

SELECT [Query Log].ID, [Query Log].Query_Date, [Query Log].Query_Time, [Query Log].Query_Status, [Query Log].Remarks, [Query Log].Customer, [Query Log].Requestor_Name, [Requestor Names].Coordinator
FROM [Query Log] INNER JOIN [Requestor Names] ON [Query Log].Requestor_Name=[Requestor Names].Requestor_Name
WHERE ((([Query Log].Query_Status)<>"Submitted & Closed" And ([Query Log].Query_Status)<>"Dropped")) And ([Requestor Names].Coordinator)=[Forms]![Queriesparameter]![Coordinator]

Any resolution will be really helpful.
 
The problem is that you CANNOT have criteria on any field of the table that is joined with an OUTER JOIN except to have Is Null or Is Not Null. Anything else needs to have a separate query built with that criteria (to select the value for Coordinator with the combo) and then THAT query put into the other query and joined to the Query Log table like you originally had the outer join in there.
 
Thanks for your Reply.

What I found strange was that, when in the above code instead of refering to a Form to capture the input if I give Fixed Value the query is working. I think there is some problem with linking the Form input to query. Any suggestion?

Also can you advise me on some sample database to refer to in order to get better knowledge of this.
 
Thanks for your Reply.

What I found strange was that, when in the above code instead of refering to a Form to capture the input if I give Fixed Value the query is working. I think there is some problem with linking the Form input to query. Any suggestion?

Also can you advise me on some sample database to refer to in order to get better knowledge of this.

Turns out that I messed up and thought I saw an OUTER join when in fact it was an INNER join. So, yes, you can do what you are doing and the question is - is this control a combo box? And if so, do you have the bound column set to be correct to return the value that Coordinator is looking for?
 

Users who are viewing this thread

Back
Top Bottom