sorting a combobox

nsmoller
09-08-2003, 06:38 PM
i searched for an answer on this subject but i dunno... what do you guys think...


two combo boxes, one with a string based name and a string based id number

i want to relate the two together, so i figure an array

so a FOR NEXT loop populating both listboxes and an array based on the index of the name combobox...

the only issue i've come across - when i sort the combo boxes, that screws up indexes, right? then the array wont relate maybe yes maybe no?

thanks in advance for any light...

Legend
09-08-2003, 06:49 PM
Use a two-dimensional array. Sort the array, then populate the combo boxes. :)

Lar_19
09-08-2003, 07:01 PM
I'm not sure I understand what you are trying to do, but if you need to synchronize a combo box list with an array you can do it with the combo's ItemData property. Just assign the array index to the ItemData property of the combo list item it relates to. The ItemData property remains constant even if the ListIndex for the item changes.

Val
09-08-2003, 07:12 PM
So sort only one and store the indexes of related items from second box in the ItemData.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum