http://bytes.com/topic/access/answer...do#post3790250
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:
Expand|Select|Wrap|Line Numbers
- 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