My cbo is bound to a table and I am looking through the "description"
column. (2)
I tried cbo.FindString(SearchValue) and that fails to get more then index
= 1
Also tried (searchValue, 2 ) to no avail?
Instead I am passing the cbo and the search string to a separate looping
function to get the index.
What I want:
Case "Sales"
test = cbo.FindString(testStr)
What I am using:
Case "Sales"
test = FindComboBoxValue(cbo,
dr.Item(RowNum).DataBoundItem(0))
Private Shared Function FindComboBoxValue(ByVal cbo As ComboBox, ByVal
text As String) As Integer
Dim int1 As Integer
For int1 = 0 To cbo.Items.Count - 1
cbo.SelectedIndex = int1
If cbo.SelectedItem(2) = text Then
FindComboBoxValue = int1
Exit Function
End If
Next
End Function
Do you see what I'm doing wrong? I'd rather not loop the cbo if I can
help it.
TIA
Stephen Russell
AutoZone Contractor
Desk 901.495-7916
Cell 901.246-0159
Memphis TN
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com