Hello,
I am having a lot of problems writing a query to run in a vba module. I am trying to use an insert-select statement for all of the values except for one, and for that exception, I am trying to use a variable value or another query.
Here is the code:
I get the following error when I run the above code:
Thank you.
I am having a lot of problems writing a query to run in a vba module. I am trying to use an insert-select statement for all of the values except for one, and for that exception, I am trying to use a variable value or another query.
Here is the code:
Code:
strDwnSystemsSQL = "INSERT INTO active_steps"
strDwnSystemsSQL = strDwnSystemsSQL & " ([System],[Step_Number],[Task_Name],[Communication_Type],[Time_Interval],[Step_Type],[Priority],[Facility],[Primary_Group],[Secondary_Group],[Primary_Person],[Secondary_Person],[Step_Notes], [Downtime_Name]) "
strDwnSystemsSQL = strDwnSystemsSQL & "SELECT [System],[Step_Number],[Task_Name],[Communication_Type],[Time_Interval],[Step_Type],[Priority],[Facility],[Primary_Group],[Secondary_Group],[Primary_Person],[Secondary_Person],[Step_Notes]," & strDwnTimeName
strDwnSystemsSQL = strDwnSystemsSQL & " FROM System_Steps WHERE [System] = " & strDwnSystems
I get the following error when I run the above code:
Run-time error '3464' Datatype mismatch in criteria expression
Thank you.