I am currently trying to add to my VB6 combobox using the AddItem method. This works, however, I want to display text in the drop down but I need to pass the ID of that text.
Is there a way to accomplish this by using the AddItem method?
It can't be done in the AddItem
method but it's fairly easy to do it immediately after, using the NewIndex
property, as long as the ID is a numeric value:
With Combo1
For i = 16 To 34
.AddItem "Item " & i
.ItemData(.NewIndex) = i
Next
End With
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With