Link to home
Start Free TrialLog in
Avatar of merlin007
merlin007

asked on

how to read the itemdata of a selected item in combo

I have entered a long as itemdata as I loaded the combo box. Now when the user selects an option in the combo i want to be able to read the corresponding value I loaded in the itemdata property.

I cannot find any info on this.

Can anyone help

Thanks

Merlin007

Avatar of Gunsen
Gunsen

Combo1_Click()
MsgBox Combo1.ItemData (Combo1.ListIndex)
End Sub
ASKER CERTIFIED SOLUTION
Avatar of ajexpert
ajexpert
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Modify third line as
    Msg = Msg & Combo1.List(Combo1.ListIndex)
Avatar of merlin007

ASKER

Thanks

Merlin007
Dim lListIndex as long
if combo.listINDEX <>-1 then
 lListIndex=combo.itemdata(combo.listindex)
end if
sorry sudarshan shir, I had awarded the points before your answer came in. I am however using your code.

Thanks everyone
merlin007