From: hamsa via on
Dear All,

Thank You very much for the reply. I will give the code that I am using below:

SELECT Sutras.SutraNo, Index.Properties, Sutras.Sutra
FROM Sutras INNER JOIN [Index] ON Sutras.SutraId=Index.SutraId
WHERE (((Index.TopicId) In (SELECT Topics.TopicId FROM Topics WHERE Topics.
Topic = [Enter the Dhatu Name (Ex: - bhü)] )))
ORDER BY Sutras.SutraNo;

In the Inner SELECT statement, I have the code [Enter the Dhatu Name (Ex: -
bhü)] after =.
I want to remove this and instead use the value in the column of the row
selected in the combo box.
How do I do that? I can use either a Combo box event like On Change or I can
also have an EXECUTE button which when clicked will pass the value from the
combo box to the Inner SELECT statement of the SQl query. My requirement is
that I have to avoid the parameter popup window as the user has already
selected the row in the combo box.

I retained the present code as I coult not figure out how to pass the value
from the combo box to the SQL query.

After a row is selected in the combo box, I want the value of the column in
the row selected passed as the selection criteria to the Inner SELECT.

At present, the COmbo box Control source property is blank and the Bound
Column property is set to 1.

John Spencer wrote:
>Normally, you would refer to the control in the query. The form must be open
>when the query executes. For a combobox that will return the value of the row
>that is selected and the column that you have designated as the bound column.
> Forms![Name of Form]![Name of Combobox]
>That may not work for you depending on how you have nested the queries. If
>you have used a sub-query in the from clause then this may fail. If you have
>a saved query that you are referencing in the from clause then this should
>work with no problem.
>If this does not work for you, then you need to post the SQL of your queries
>so we can see what is happening.
>(Possibly unneeded instructions follow)
>Open the query
>Select View:Sql from the Menu
>Select all the text
>Copy it
>Paste it into the message
>John Spencer
>Access MVP 2002-2005, 2007-2010
>The Hilltop Institute
>University of Maryland Baltimore County
>> Hello,
>[quoted text clipped - 26 lines]
>> Thanks in Advance.

Message posted via