I have been working to impliment the example at the link below (just as an FYI, great tutorial!) It goes through how to create a search as you type list box. I have run into one problem I was hoping someone could help with. It provides the code below in one of the steps.
Code:
Private Sub txtSearch_Change()
'CODE THAT HANDLES WHAT HAPPENS WHEN THE USER TYPES IN THE SEARCH BOX
Dim strFullList As String
Dim strFilteredList As String
10 If blnSpace = False Then
20 Me.Refresh 'refresh to make sure the text box changes are actually available to use
'specify the default/full rowsource for the control
30 strFullList = "SELECT RecordID, First, Last FROM tblNames ORDER BY First;"
'specify the way you want the rowsource to be filtered based on the user's entry
40 strFilteredList = "SELECT RecordID, First, Last FROM tblNames WHERE [First] LIKE ""*" & Me.txtSearch.Value & _
"*"" OR [Last] LIKE ""*" & Me.txtSearch.Value & "*"" ORDER BY [First]"
'run the search
50 fLiveSearch Me.txtSearch, Me.lstItems, strFullList, strFilteredList, Me.txtCount
60 End If
End Sub
In row 30 & 40 the Row source needs to be added. I have taken the Row source from my list box and added as specified where I have run into problems is inplementing into line 40 where text searching begins. Please see my row source code below. Any help would be greatly appreciated!
Thanks
Code:
SELECT tblQuestions.QstnID, tblQuestions.QstnText, tblQuestions.SrvID FROM tblQuestions WHERE (((tblQuestions.SrvID)=[Forms]![frmSurveyResponses]![cboSurvID]));