Cascading Combo Boxes w/ SQL in a PRoject

P

pltaylor3

For some reason I cannot get this code to create my cascading combo
box.

SELECT EngineNumber FROM dbo.Engine
Where(((Program)=[forms]![Selection]![prgrm]))

This is pulling information from a SQL database that the form is linked
to and it gives me the error "Incorrect Syntax near '!'" the names of
the access value are correct and the query works when i stick a value
for prgrm in place of the "[forms]![Selection]![prgrm]"
any help would be greatly appreciated.
thanks
 
P

pltaylor3

That leads to an empty combo box. I am open to suggestions. I believe
it is passing the value & [forms]![Selection]![prgrm] & instead of what
that value should represent (i.e. the value in the text box prgrm).



Try this:

SELECT EngineNumber FROM dbo.Engine
Where(((Program)='" & [forms]![Selection]![prgrm] & "'"))

For some reason I cannot get this code to create my cascading combo
box.

SELECT EngineNumber FROM dbo.Engine
Where(((Program)=[forms]![Selection]![prgrm]))

This is pulling information from a SQL database that the form is linked
to and it gives me the error "Incorrect Syntax near '!'" the names of
the access value are correct and the query works when i stick a value
for prgrm in place of the "[forms]![Selection]![prgrm]"
any help would be greatly appreciated.
thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top