
Listbox/Combobox - .Sorted=True doesn't sort ItemData
Below is just one example of what I'm running into:
I'm populating a dropdown combobox with state abbreviations from a SQL
Server table where the Select does an Order By on the state name. The
following is the structure of the state table:
Column_name Type Length
state_id int 4
state_code char 2
name varchar 25
start_date datetime 8
end_date datetime 8
revised_by int 4
revised_date datetime 8
I have the .Sorted property set to True and am placing the state_id as the
ItemData values. Trouble is, as I'm inserting the state_code and it's
being sorted, if a state_code gets moved up in the list, the ItemData of
the updated position value gets set to 0. I know I can do an Order By on
state_code but, for the time being, I can't, as this would affect other
forms and time constraints prevent us from adding additional methods to the
DLL (all database access is done via components we've developed in VC 5.0
DLLs).
Basically, what I'm trying to say is it looks like the .ItemData values are
not tied to the .List values when the .Sorted property is set to True. I
assume this is by design but it sure would be nice to have the two tied
together.
--
Later....
Jerry D. Turner (MVP - DTS / MCSE / ClubWin / ClubIE)
http://www.*-*-*.com/