Excel VBA order of data in ComboBox

  Heefie 16:01 26 May 08

Hi all, hopefully an easy one ... I'm using VBA in Excel 2003 & am loading a ComboBox from an Access 2003 database as follows :

With KA_Form.KA_ComboBox1
.AddItem KA_RS_Leagues![League_Name]
Loop Until KA_RS_Leagues.EOF
End With

It works fine, if, for instance, I have 3 entries, "A", "C" & "E", they will display in the ComboBox in that order, exactly as I want.

If I then Add "B" or "D", or if I delete "C" and re-Add "C", the next time that I look at the ComboBox, they are not in order, it will list "A", "E" and then the newly added "B", "C" or "D" ...

Is it possible to make these display in Alphabetical order, EVERY time they are listed, regardless of their order in the Database (The database consists of 2 fields only, an AutoNumber and the Alphabetical entry, League_Name) ?

I think that all makes sense .......

  VoG II 16:05 26 May 08

Here's some code click here that sorts values in a ComboBox.

  Heefie 16:38 26 May 08

... so re-thought it, and asual, it was staring me in the face ... I have the option of ORDER BY [League_Name] when I set up the RecordSet !!!

Thanks though, VoG, it helped in a round-about sort of way !!!

This thread is now locked and can not be replied to.

Nintendo Switch review: Hands-on with the intuitive modular console and its disappointing games…

1995-2015: How technology has changed the world in 20 years

This abstract video touches on division in our technologic world

Best alternatives to iTunes for Mac | Best music players for macOS: Free your music from the…