VBA Code Error

Stormrider83

Computer Science Student
Local time
Today, 21:22
Joined
Jul 16, 2008
Messages
26
Hi,

I am trying to copy records from an access query to a table. This is my code:

Code:
strSQL = ""
strSQL = strSQL & " INSERT INTO Tbl_Paint_Order_Parts (Paint_Order_ID, Part, Qty) "
strSQL = strSQL & " SELECT Paint_Order, Part_No, Qty FROM [Qry_Sum_Rpt_Paint_Order]; "
CurrentDb.Execute strSQL

And I get the error:

Run Time Error '3061'
Too Few Parameters. Expected 2.

Have checked table names etc. Any Ideas?

One thing it may be the Qry takes a parameter from the form but the VBA code is in said form so it should pass that across right?
 
What is the sql for the query Qry_Sum_Rpt_Paint_Order??
 
Hi,
Why don't you just create an append query based on your query to append the data to your table or change the query to an append query to append the required data to your table??

John
 

Users who are viewing this thread

Back
Top Bottom