combo box in alphabetical order

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm sure there's a simple solution to this, but I can't seem to figure it out:
I have a combo box on a form and I would like the drop-down list to be in
ascending order by the field name rather than the auto ID order. The field
names are showing, but they're not in alphabetical order. I couldn't find
any place in the properties box that gives me the option.

Patti
 
I'm sure there's a simple solution to this, but I can't seem to figure it out:
I have a combo box on a form and I would like the drop-down list to be in
ascending order by the field name rather than the auto ID order. The field
names are showing, but they're not in alphabetical order. I couldn't find
any place in the properties box that gives me the option.

Patti

Base the combo box on a Query sorting the data as you wish to see it.

To do so, view the combo's properties; click the ... icon by the
RowSource property, and accept Access' offer to open the table as a
Query. Select Ascending on the order by property of the field, and
close the query window, accepting Access' offer to update the SQL
property.

John W. Vinson[MVP]
 
Open the rowsource query and in the column for the name field select a sort
order.
 
Hi Patti

This is because you are using your table directly as the rowsource for the
combobox, so the records are returned in order of the primary key.

Create a query based on your table. Include the ID field and the name
field, and sort on the name field. Then use your query as the rowsource
instead of the table.

Or, you can write the query SQL directly into the rowsource property:
Select [IdField], [NameField] from [YourTable] order by [NameField];
 
Open the Row Source property of the combo box, and set the order by the field
name in the SQL (query)

Select ID , [field name] From TableName Order By [field name]
 

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

Similar Threads


Back
Top