-
Hi,
I have the following:
1) Text file named Text.txt with the following data:
Blue Car
Red Car
Blue Truck
Red Truck
2) A form with a ListView (ListView1), Text box (Text1) and Command button (Command1).
Here's what I would like to accomplish. The ListView would not be populated until the user types in some text in the text box and hits the command button. The listview would then be populated with anything that matches the text entered into the text box. So using the above data, if the user entered bl in the search box, the listview would be populated with:
Blue Car
Blue Truck
Any ideas on how to accomplish this would be appreciated..
Dan
-
I assume you know how to read the text file. So once you have done that you can put each line in MyString and do something like the following:
Code:
Dim strLookFor As String
Dim MyString As String
MyString = "Blue Truck"
strLookFor = "bl"
If InStr(1, UCase(MyString), UCase(strLookFor)) Then
MsgBox "I found it"
End If
By the way, the above is not case sensitive. To make it case sensitive just remove the UCase functions.