Split from thread:
1 - How do I search more than one table in a keyword search? (I know I need a join or a UNION but I'm not sure how to implement it)
Essentially I have this code to search a set of tables:
And I'm wondering how do I incorporate a UNION to add a second table to the search? The 2nd table I want to search is tblContact
1 - How do I search more than one table in a keyword search? (I know I need a join or a UNION but I'm not sure how to implement it)
Essentially I have this code to search a set of tables:
Code:
Private Sub btnSearch1_Click()
On Error GoTo problem
Dim strsearch As String
Dim strText As String
'
strText = Me.TxtSearch1.Value
strsearch = "SELECT * " & _
"FROM [tblCompany] " & _
"WHERE (([Company_name] LIKE ""*" & _
strText & "*"") OR(Quote_Type LIKE ""*" & _
strText & "*""))"
Me.RecordSource = strsearch
'
End Sub
And I'm wondering how do I incorporate a UNION to add a second table to the search? The 2nd table I want to search is tblContact
Comment