I am trying to build an Excel based VBA query to return all records that contain a text string in one of the table fields.
I want to return all records where the text fri is in a field name 'Production' whic has been entered in the the range named 'Controls_SearchProductionBuyers'
I am getting an error stating the following
Syntax error (missing operator) in query expression 'Production WHERE Production Like '%fri''.
TIA
I want to return all records where the text fri is in a field name 'Production' whic has been entered in the the range named 'Controls_SearchProductionBuyers'
Code:
strQuery = "SELECT Buyer, Production WHERE Production Like '%" & Range("Controls_SearchProductionBuyers") & "%'"
Syntax error (missing operator) in query expression 'Production WHERE Production Like '%fri''.
TIA