Visual Basic 6
I have this code which finds a numeric value inputted into a text box and highlights it in a listbox, but now i want to amend it to so that i can enter either a numeric value or text into the text box but dont know how, can anyone help?
please help
I have this code which finds a numeric value inputted into a text box and highlights it in a listbox, but now i want to amend it to so that i can enter either a numeric value or text into the text box but dont know how, can anyone help?
PHP:
Private Sub cmdFind_Click()
If lstMarks.ListIndex <> -1 Then
lstMarks.Selected(lstMarks.ListIndex) = False
End If
If lstNames.ListIndex <> -1 Then
lstNames.Selected(lstNames.ListIndex) = False
End If
Dim lngIndex As Long
For lngIndex = 0 To lstMarks.ListCount - 1
If Val(lstMarks.List(lngIndex)) = Val(txtFind.Text) Then
lstNames.Selected(lngIndex) = True
lstMarks.Selected(lngIndex) = True
LblMessage.Caption = "Record Found !"
Exit Sub
End If
Next
LblMessage.Caption = "Record Not Found !"
End Sub
please help