Can the Select Into statement be used to insert data from one table to another table that already exists? I can insert data into a new table, but not into one that already exists.
SELECT QtyOnHand, UnitCost, ItemID FROM Inventory
and insert those values into another table (InvTransactions_Detail). I know that I can create a recordset and loop though it and do an insert into command, but I was trying to learn a new way using just the connection.execute command. I have managed to do exactly this with the select into , but only into a new table and not into an existing table.
It looks simple enough now that I see it. I've tried the sql statement. It produces no errors, but it neither inserts any rows. But at least it a start. I'll play with it some more. Thanks for the link to the SQL forum. I've been a member here for > 7 years and never new it existed. Thanks again
Are there any records in Inventory? Are duplicate records allowed in InvTransactions_Detail? If you are using CurrentDB.Execute, you must use dbFailOnError, if you do not wish the SQL to fail silently.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.