Quote:
>We are trying to use a text box that will allow a person to type in
>more than just the first letter, and have it scroll through the entire
>list. Using the combo box, we can type in the first letter, but we
>need people to type an entire string and have it search that string
>(like the Search box in Help). Any suggestions? This list has helped
>me tremendously, and I am extremely greatfull for it.
>-Scott Charlton
If I understand you correctly you need to search for an intire string in a list box.
The code below will search the list with each additional character entered, getting
more specific with each character entered.
In the Text1 Key Down event place this code.
Check = LEN(LTRIM$(Text1.Text)) 'get the length of the string in Text1
CheckText$ = LTRIM$(Text1.Text) 'get just the non null characters in Text1
FOR i = 0 TO List1.ListCount - 1 'set the counter to check each item in the list
List1.ListIndex = i
IF LEFT$(List1.List(i), Check) = CheckText$ THEN 'check the item aginst Text1
EXIT FOR 'if the string is found stop search
END IF
NEXT i
I hope this will help.
Good Luck,
Bryan