J.R. Sitman
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
How are you initially populating the combobox and how are you adding items to it?
ASKER
from a table.
ASKER
You made me realize what I need. I created a query and based the RowSource on it. That fixed it.
ASKER
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"....
ASKER
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.
ASKER
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.
Just be aware that the sort will get funky if your "numbers" ever go above 9.
ASKER
thanks
ASKER