G
Gary Paris
I have a question regarding the combobox. I populated a Combobox on my
Windows form by databinding. In table I am binding contains a StaffID field
and a StaffName field.
When I ran a query to retrieve a field, I wanted to display the correct
value (StaffName) in the combobox. This is the code I came up with to do
that and was wondering if there is an automatic way to do this without
looping through the combobox
For index = 0 To cmbStaff.Items.Count - 1
cmbStaff.SelectedIndex = index
If rowContact("staff") = cmbStaff.SelectedValue Then
Exit For
End If
Next
Thanks,
Gary
Windows form by databinding. In table I am binding contains a StaffID field
and a StaffName field.
When I ran a query to retrieve a field, I wanted to display the correct
value (StaffName) in the combobox. This is the code I came up with to do
that and was wondering if there is an automatic way to do this without
looping through the combobox
For index = 0 To cmbStaff.Items.Count - 1
cmbStaff.SelectedIndex = index
If rowContact("staff") = cmbStaff.SelectedValue Then
Exit For
End If
Next
Thanks,
Gary