chrislee8
asked on
sorting problem in VB's combo box.
hi all,
I have a recordset contains 2 fields.
here is my code to load the recordset to the combo box:
cboBoxToLoad.Clear
objADORecordset.MoveFirst
Do While Not objADORecordset.EOF
cboBoxToLoad.AddItem objADORecordset.Fields(0)
If bIsItemData Then
cboBoxToLoad.ItemData(cboB oxToLoad.N ewIndex) =
objADORecordset.Fields(1)
End If
objADORecordset.MoveNext
Loop
in the database, I am setting the fields(0) desc and asc. but no matter what
i set, the combo box shows up the records asc for the fields(0).
Please help!
I have a recordset contains 2 fields.
here is my code to load the recordset to the combo box:
cboBoxToLoad.Clear
objADORecordset.MoveFirst
Do While Not objADORecordset.EOF
cboBoxToLoad.AddItem objADORecordset.Fields(0)
If bIsItemData Then
cboBoxToLoad.ItemData(cboB
objADORecordset.Fields(1)
End If
objADORecordset.MoveNext
Loop
in the database, I am setting the fields(0) desc and asc. but no matter what
i set, the combo box shows up the records asc for the fields(0).
Please help!
Set the Sorted property of the ComboBox to True. It will Solve Your Problem
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am sorry, Dambalaji, leg1 is right.
leg1, would you answer the question so that i can give you the points.
Dam, again, nothing personal.
Thank you guys so much for your time.
it works well now.
chris :)
leg1, would you answer the question so that i can give you the points.
Dam, again, nothing personal.
Thank you guys so much for your time.
it works well now.
chris :)
chrislee, you can accept leg1's comment as an answer. Look at the "title bar" on leg1's comment.
;-)
ASKER