SteveMac32
Programmer
Hi Guys I am loading a combo box
With cboSalesCallReason
.Clear
Do Until rs.EOF
.AddItem Trim(rs!CallReason)
.ItemData(.NewIndex) = rs!URN
rs.MoveNext
Loop
End With
I need to set the combo box depending on the .ItemData (the URN).
So is it possible to select an item in a drop down list via it's .ItemData value as opposed to the .List/.ListItem value..
the only way I can see is by using this loop
Dim i As Integer
For i = 0 To cboSalesCallReason.ListCount - 1
If cboSalesCallReason.ItemData(i) = URN Then
cboSalesCallReason.ListIndex = i
Exit For
End If
Next
Any other ideas ??????
Thanks
Steve
With cboSalesCallReason
.Clear
Do Until rs.EOF
.AddItem Trim(rs!CallReason)
.ItemData(.NewIndex) = rs!URN
rs.MoveNext
Loop
End With
I need to set the combo box depending on the .ItemData (the URN).
So is it possible to select an item in a drop down list via it's .ItemData value as opposed to the .List/.ListItem value..
the only way I can see is by using this loop
Dim i As Integer
For i = 0 To cboSalesCallReason.ListCount - 1
If cboSalesCallReason.ItemData(i) = URN Then
cboSalesCallReason.ListIndex = i
Exit For
End If
Next
Any other ideas ??????
Thanks
Steve