I have been away from Access for 7 years, and boy have I gone rusty.
I am trying to do a search routine that allows words to be entered in a text box separated preferably by commas, that will select those records where those words are contained.
I tried this, but did not get very far.
First problem I had was not setting focus to Text1, maybe I should have relayed it on to a label?
However even after that, still stuck on syntax to allow multiple words entry to search on.
Appreciate any help. Thanks
I am trying to do a search routine that allows words to be entered in a text box separated preferably by commas, that will select those records where those words are contained.
I tried this, but did not get very far.
Code:
Dim rs As DAO.Recordset
Dim db As DAO.Database
Set db = CurrentDb()
Set rs = db.OpenRecordset("Table1", dbOpenDynaset)
Me.List2 = Null
txtSearchString = Trim(Me.Text1.Text & "*")
strSQL = ""
strSQL = "SELECT TABLE1.ID1, TABLE1.Documents FROM Table1 "
strSQL = strSQL & "WHERE ((TABLE1.DOCUMENTS) Like '" & txtSearchString & "*') "
Me.List2.RowSource = strSQL
Me.List2.Requery
First problem I had was not setting focus to Text1, maybe I should have relayed it on to a label?
However even after that, still stuck on syntax to allow multiple words entry to search on.
Appreciate any help. Thanks