sort combo box list

S

Sherrie

How do I get a certain column in a combo box to be
alphatized?
eg:
My combo box consists of 2 columns: Account Number and
Account Name, it defaults to sort Account Number, but I
would like it to sort with the Account Name.

I have sorting it that way in the table -that doesn't work.
I have tried selecting the column I want sorted first with
the wizard setting up the combo box-that doesn't work
either.

Thanks!!
 
B

Bas Cost Budde

Sherrie said:
How do I get a certain column in a combo box to be
alphatized?
eg:
My combo box consists of 2 columns: Account Number and
Account Name, it defaults to sort Account Number, but I
would like it to sort with the Account Name.

I have sorting it that way in the table -that doesn't work.
I have tried selecting the column I want sorted first with
the wizard setting up the combo box-that doesn't work
either.

Thanks!!

Open the form in design view, select the combobox, display properties
window. On the Data tab, check the rowsource property; there should be
something starting with SELECT there. Click the Build button (three
dots). You get a query design grid; drag or dblclick the field you want
to sort on from the field list to a column, uncheck the display checkbox
and choose Ascending from the "list" right above this checkbox. Close.
Apply? Yes of course, Access. View the form.
 
P

Pavel Romashkin

You can try using an ORDER BY clause in the SQL that defines the Row
Source for the combo box. For example,

SELECT AcctNumber, AcctName FROM myTable ORDER BY AcctName

You can make this change in the Data tab of the Properties sheet of the
combo box.
Pavel
 
J

Jim/Chris

Go to design view in form
right click on combo box and select properties
Click on row source and the the three ...
The query will be opened in design view
select ascending in the sort row for the account name field
remof ascending from the account number field if necessary
Close and save

Jim
 
F

fredg

How do I get a certain column in a combo box to be
alphatized?
eg:
My combo box consists of 2 columns: Account Number and
Account Name, it defaults to sort Account Number, but I
would like it to sort with the Account Name.

I have sorting it that way in the table -that doesn't work.
I have tried selecting the column I want sorted first with
the wizard setting up the combo box-that doesn't work
either.

Thanks!!

Change the rowsource of the combo from your table to a SQL statement:

Select [Account Number], [Account Name] from YourTableName Order By
[Account Name];

Change the table and field names as needed,
 

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