Alphabetical order

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
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.
 
Back
Top