wysiwygGER01
Programmer
Hi,
I've got a form with a list box and a text field in VB6.
I want to implement a search-as-you-type function.
My code below works just as it should but only if the list box is not multi-select.
I don't understand why this won't work with a multi select list box.
Any help would be much appreciated...
Private Sub txtfind_Change()
Dim x, z
RequisitionList.ListIndex = -1
For x = 0 To RequisitionList.ListCount - 1
RequisitionList.ListIndex = x
z = RequisitionList.Text
If LCase(Left(RequisitionList.Text, Len(txtfind.Text))) = LCase(txtfind.Text) Then
Exit Sub
End If
Next x
End Sub
I've got a form with a list box and a text field in VB6.
I want to implement a search-as-you-type function.
My code below works just as it should but only if the list box is not multi-select.
I don't understand why this won't work with a multi select list box.
Any help would be much appreciated...
Private Sub txtfind_Change()
Dim x, z
RequisitionList.ListIndex = -1
For x = 0 To RequisitionList.ListCount - 1
RequisitionList.ListIndex = x
z = RequisitionList.Text
If LCase(Left(RequisitionList.Text, Len(txtfind.Text))) = LCase(txtfind.Text) Then
Exit Sub
End If
Next x
End Sub