Alphabetical order

G

Guest

I have a form with a drop down list. Data for the drop down list looks at a
query where the values are in alphabetical order, however the drop down list
on the form is not.
any suggestions?
Thanks
 
J

Jeff Boyce

Nikki

When you run the query, it comes out alphabetized, but when you drop the
combo box based on the query, it isn't? Please post the SQL statement your
combo box uses. Are the combo box's properties set appropriately?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

It may be that the query's rows have been sorted by setting its OrderBy
property, which is what the A-Z and Z-A toolbar buttons do in datasheet view.
If you then save the layout of the query the OrderBy property is saved as
part of the query definition. Queries should really be sorted by an ORDER BY
clause, however, which is what selecting Ascending or Descending in the Sort
row in the query design grid does.

In SQL view the query should look something like this:

SELECT City
FROM Cities
ORDER BY City;

You don't have to use the saved query as the combo box's RowSource, the SQL
statement itself will do and with no loss in performance as it will be
compiled. If you build the RowSource property of a combo box from its
properties sheet but don't save the query this will insert the SQL which
Access constructs as the RowSource property of the query.

Ken Sheridan
Stafford, England
 
G

Guest

Add an ORDER BY clause to the SQL statement for the field you want to sort
on. Post you SQL if you'd like more specific help.
 

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