SimoneRene
Registered User.
- Local time
- Today, 01:53
- Joined
- Mar 15, 2017
- Messages
- 58
Hi Folks,
I have a form with a continuous sub form in it, I'm trying to get a keyword search to work. But as the continuous form is based on a union query from 3 tables I'm having a struggle.
The keyword search is for one column only 'Product'. The problem is in two of the three tables the 'Product' column isn't called product it's called 'part' and 'used on' so to get the query to work its 'Part As Product' and 'Used on As Product'. My WHERE clause is therefore wrong, any tips?
I have the following code behind an on click event of a button:
Thanks!! =]
I have a form with a continuous sub form in it, I'm trying to get a keyword search to work. But as the continuous form is based on a union query from 3 tables I'm having a struggle.
The keyword search is for one column only 'Product'. The problem is in two of the three tables the 'Product' column isn't called product it's called 'part' and 'used on' so to get the query to work its 'Part As Product' and 'Used on As Product'. My WHERE clause is therefore wrong, any tips?
I have the following code behind an on click event of a button:
Code:
Private Sub SearchBtn_Click()
Dim SQL As String
SQL = "SELECT [DDP Issue Control].[DDP Ref] AS [Document Number], [DDP Issue Control].Description, [DDP Issue Control].Part AS Product, [DDP Issue Control].Type, [DDP Issue Control].[File Name], [DDP Issue Control].[Hyperlink to File] FROM [DDP Issue Control]
UNION SELECT [AS Specs Issue Control].[Specification No] AS [Document Number], [AS Specs Issue Control].[Title of Specification] AS Description, [AS Specs Issue Control].[Used On] AS Product, [AS Specs Issue Control].[Doc Type] AS Type, [AS Specs Issue Control].FileName AS [File Name], [AS Specs Issue Control].[Hyperlink to File] FROM [AS Specs Issue Control]
UNION SELECT [CMM Issue Control].[CMM No] AS [Document Number], [CMM Issue Control].Description, [CMM Issue Control].Product, [CMM Issue Control].Type, [CMM Issue Control].[File Name], [CMM Issue Control].[Hyperlink to File] FROM [CMM Issue Control]
[COLOR=yellow][COLOR=black]WHERE [Product] Like "" * " & Me.KeywordsTxt & " * "";"[/COLOR] [/COLOR]
Me.SubProductList.Form.RecordSource = SQL
Me.SubProductList.Requery
End Sub
Thanks!! =]