I'm attempting to append a table using only a few fields from another table.
Unfortunately, I have to take a generalized approach with the "master" table (the one being appended) since it needs to hold a listing of information from several tables. So my thought process was to add a field, ProjAndIrun, into the "master" table which isn't found in the other tables to differentiate between the several different "projects."
Well, I'm having a hard time adding the information to the master table through an SQL command line. Using a query it'll open up an input box, but when replacing the "expr1" with a variable previously defined in the coding I receive an "Incomplete Query Cause" error (Error 3450).
The line works when I remove the project variable and associated field name, but I need for that information to be added to the "master" each time.
Any ideas?
Thanks in advance!
Unfortunately, I have to take a generalized approach with the "master" table (the one being appended) since it needs to hold a listing of information from several tables. So my thought process was to add a field, ProjAndIrun, into the "master" table which isn't found in the other tables to differentiate between the several different "projects."
Well, I'm having a hard time adding the information to the master table through an SQL command line. Using a query it'll open up an input box, but when replacing the "expr1" with a variable previously defined in the coding I receive an "Incomplete Query Cause" error (Error 3450).
The line works when I remove the project variable and associated field name, but I need for that information to be added to the "master" each time.
Any ideas?
Code:
SQL = "INSERT INTO Master_Test_Table ( Product_Number, Serial_Number, Asset_Number, PO_Number, ProjAndIrun )" _
& " SELECT MODEL_NUMBER, SERIAL_NUMBER, ASSET_NUMBER, PO_NUMBER, ProjAndIrun AS " & strProject _
& " FROM '" & strTestTable & "';"
CurrentDb.Execute SQ
Thanks in advance!