mtagliaferri
Registered User.
- Local time
- Today, 02:37
- Joined
- Jul 16, 2006
- Messages
- 519
I have the following code that performs a search perfectly, but it will only search one parameter, I would like to be able to type in the search box two or more parameters to filter further down the records, example "Surname" & "EventType".
I want to keep only one search box in the form, any suggestions?
I want to keep only one search box in the form, any suggestions?
Code:
Private Sub CmdSearch_Click()
Dim strSearch As String
Dim strTxt As String
strTxt = Me.TxtSearchBox.Value
strSearch = "SELECT * from qryUpdatesTimeline where ((FirstName like ""*" & strTxt & "*"") or (Surname like ""*" & strTxt & "*"") or (EventType like ""*" & strTxt & "*""))"
Me.RecordSource = strSearch
Me.RecordSource = Replace(strSearch, "{0}", Me.TxtSearchBox)
Me.TxtSearchBox = ""
End Sub