Combo Box Not Working

chrisguk

Registered User.
Local time
Today, 10:07
Joined
Mar 9, 2011
Messages
148
Hi,

I created a combo box and typed the following under record row source:

[SELECT tblsites].[* FROM tblsites ORDER BY [tblsites]].[[sitesdescr]

But it will not work, when I tried to use the wizard to create a combo box that will select the record based on the drop down value it stated there was a syntax error. The code above is what it thinks is an error.

Note I do have a subform on the form so I am not sure if that will make a difference.

sitesID is the primary key on the table by the way. And sitesdescr is just the description of the site.
 
If you go wrong in SQL-syntax as per above, the best trick is to create a query in the query designer (QBE) and from there copy the SQL that you can see in the SQL-view of the query.
 
As spikepl mentioned use the QBE. Instead of copying and pasting just click the elipsis button (...) in the Row Source and the QBE will open up.
 
#3 ... provided the QBE can decode what's there :)

But if you empty the RowSource and start over, then vbaInet's way is the best.
 

Users who are viewing this thread

Back
Top Bottom