Hello all and Happy New Year!
Can you filter a List as you input new data into a Control Textbox????
Have a Form. On that form I have a Listbox to display all of the "Existing" Streets in the Db. The form is bound to dta_Streets and The user inputs the new Street name into StreetName.
As the user inputs a new Street Name in the Form's Control for StreetName I would like for that list box to be filtered as the characters are input so that if they input the letter M then all streets with M show then as they enter the 2nd character, let's say it's "A" then the list filters to Streets beginning with "MA" then as the enter the 3rd Character, let's say "I" then it filters the list to "MAI" etc........
This is the code I "Attempted" that with but.............. well you know......
Private Sub StreetName_Change()
Dim strStreet As String, lngStreetLength As Long
strStreet = Nz(Me.StreetName, "")
lngStreetLength = Nz(Len(Me.StreetName), 0)
Me.listExistingStreets.RowSource = "SELECT AddressStreetID, StreetName" & _
" FROM dta_Streets" & _
" WHERE (((dta_Streets.AddressStreetID)>2)) AND Left([StreetName]," & lngStreetLength & ")=" & strStreet & _
" GROUP BY dta_Streets.AddressStreetID, dta_Streets.StreetName ORDER BY dta_Streets.StreetName; "