I have found several posts concerning filtering a recordset, but I am still a little befuddled. I have a text box where a person can enter a keyword to narrow the items on a subform. This is done using a recordsource. My question is, can I then set a filter on that recordsource, and continue to filter based on keywords in a textbox narrowing the list each time I enter a keyword and hit a button to apply the filter.
So I want to take a list of 200+ items and continue to filter by entering a keyword and hitting a button, take the filtered list and filter again and again until I narrow it down to only a couple of items.
Private Sub Command91_Click()
Dim strsearch As String
Dim strText As String
If (Len(Me.TxtSearch) > 0) Then
strText = Me.TxtSearch.Value
End If
strsearch = "SELECT * from FABSubForm where ((PartNumber like ""*" & strText & "*"") or(Description like ""*" & strText & "*"") or(TYP like ""*" & strText & "*""))"
Me.RecordSource = strsearch
End Sub
I hope this makes sense, and thanks for the assistance!!!
So I want to take a list of 200+ items and continue to filter by entering a keyword and hitting a button, take the filtered list and filter again and again until I narrow it down to only a couple of items.
Private Sub Command91_Click()
Dim strsearch As String
Dim strText As String
If (Len(Me.TxtSearch) > 0) Then
strText = Me.TxtSearch.Value
End If
strsearch = "SELECT * from FABSubForm where ((PartNumber like ""*" & strText & "*"") or(Description like ""*" & strText & "*"") or(TYP like ""*" & strText & "*""))"
Me.RecordSource = strsearch
End Sub
I hope this makes sense, and thanks for the assistance!!!
Last edited: