Irog assisted in fixing the problem after Mbiz had pointed me down the correct path but I was missing a piece still.
The filtering of the list as the user inputs info into a bound textbox control works but the list is sorting based on the ID number. I need to modify the code to keep the list filtered by the StreetName (text).....
The original code that filters (unsorted) is.....
If Len(StreetName.Text) > 0 Then strSQL = "SELECT AddressStreetID, StreetName FROM dta_Streets" & _ " WHERE AddressStreetID > 2 AND StreetName LIKE '" & Me.StreetName.Text & "*'" Else strSQL = "SELECT AddressStreetID, StreetName FROM dta_Streets" End If Me.listExistingStreets.RowSource = strSQL
Now then I attempted to modify the strSQL to Group and Order the list but it makes the filtering of the list unresponsive....
The code I tried changing it to is:
If Len(StreetName.Text) > 0 Then strSQL = "SELECT AddressStreetID, StreetName FROM dta_Streets" & _ " WHERE AddressStreetID > 2 AND StreetName LIKE " & Me.StreetName & "*'" & _ " GROUP BY AddressStreetID, StreetName" & _ " ORDER BY StreetName" Else strSQL = "SELECT AddressStreetID, StreetName FROM dta_Streets" & _ " GROUP BY AddressStreetID, StreetName" & _ " ORDER BY StreetName" End If Me.listExistingStreets.RowSource = strSQL
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
PS Yes, StreetName is Text