Link to home
Start Free TrialLog in
Avatar of J.R. Sitman
J.R. SitmanFlag for United States of America

asked on

How do you change the sort order of a combo box when you add items to it in Access 2010?

How do you change the sort order of a combo box when you add items to it in Access 2010?
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of J.R. Sitman

ASKER

I added these today and they display on the bottom.

User generated image
Avatar of Norie
Norie

How are you initially  populating the combobox and how are you adding items to it?
from a table.
You made me realize what I need.  I created a query and based the RowSource on it.  That fixed it.
Thanks
Just guessing, but it sounds like you got your data from a table and used a value list as a rowsource initially and just added your new items to the end of the rowsource string, then wanted to re-sort the list.  Changing the rowsource to a query solved that issue.  Glad you got it "fixed"....
correct
I think you are always going to be unhappy with the way this list sorts.  Right now, your leading number is only a single digit.  Guess what happens when you move to two digits?  The answer is that 10 sorts between 1 and 2 rather than after 9.
thanks.  In this case, it will not grow past 9
What Pat's referring to is the difference between the way a text field sorts and the way a number field sorts.  A text field with numbers only sorts the same way as a number field IF the data is padded with leading zeros so that all values in the field have the same number of characters to the left of any decimal point (if there is one), or the values in the field are between 0 and 9, as it is in your case, for now.

Just be aware that the sort will get funky if your "numbers" ever go above 9.
thanks