Combo box selection to the top ?

TomH

Registered User.
Local time
Today, 09:47
Joined
Nov 3, 2008
Messages
111
I have a number of long-list combo boxes. What I would like to have happen is that if I make a selection in combo A, that selection comes to the top of the drop down if begin to make another selection. For example, if I have a list of states... when I choose Texas, I want Texas to be at the top of the dropdown list when I reselect that control. Currently, I have to scroll all the way down again to get to that point. It's irritating... but I don't know how to resolve it, and searching yielded no results here.

Any help is greatly appreciated!!
 
One way would simply to make sure the auto expand property is on for the combo and you can start typing and it will jump to it.

Otherwise, you will need to create a new field in the table that lists the states and call it something like SortOrder. Then you would have that field be all ones (1) and then have the combo's row source be a query/select statement which sorts by the SortOrder field first and then by State Name. In the After Update event of the combo you would use an Update query to set the currently selected state to zero (0) and then requery the combo.

You would also need to set all of the rest of the records to 1. So you would need two update queries.
 
Bob: Thanks! The Auto Expand property did exactly what I wanted.
 

Users who are viewing this thread

Back
Top Bottom