I am editing a form, in the form the combo is loaded with data from an access table. Then the combo is set to the value thats in the record. Using this code...
strYN = DBRec("Location"
For idx = 0 To cmbLocation.ListCount - 1
If cmbLocation.ItemData(idx) = strYN Then
cmbLocation.ListIndex = idx
Exit For
End If
Next idx
now later on i am trying to get the ItemData of the item in the combo
strLoc = cmbLocation.ItemData(cmbLocation.ListIndex)
now this should give me the ItemData of the selected item in the combo box, but it doesnt, it gives me the ItemData of the item thats loaded first in the combo box, but not the one selected. What can I do to get the ItemData of the selected Item?
Hope this makes sense, thanks for any help
strYN = DBRec("Location"
For idx = 0 To cmbLocation.ListCount - 1
If cmbLocation.ItemData(idx) = strYN Then
cmbLocation.ListIndex = idx
Exit For
End If
Next idx
now later on i am trying to get the ItemData of the item in the combo
strLoc = cmbLocation.ItemData(cmbLocation.ListIndex)
now this should give me the ItemData of the selected item in the combo box, but it doesnt, it gives me the ItemData of the item thats loaded first in the combo box, but not the one selected. What can I do to get the ItemData of the selected Item?
Hope this makes sense, thanks for any help