delete autonumber field or append without it

G

Guest

I want to append a group of tables that contain primary key autonumber fields
into matching tables. I want to append all fields except of course the
autonumber field. I want to use sql rather than queries and i don't want to
list all the fields except the autonumber field in the sql. How do I either
delete the autonumber field before appending or exclude it in the sql?

This is the code I have now which of course gets an error due to the primary
key autonumber field in the table to be appended.

DoCmd.RunSQL "INSERT INTO TableName SELECT TableName1.* FROM TableName1;"

Thanks
 
G

Guest

INSERT INTO tbl1 ( Field2, Field3)
SELECT tbl2.Field2, tbl2.Field3
FROM tbl2;

Just leave out the field you don't want to append.
 
G

Guest

I have a lot of large tables and don't want to have to list all the fields
except the autonumber field.
 
D

Douglas J. Steele

It's a one-time thing to create the query, and, to be honest, it's safer to
do it that way to ensure that the fields are in the correct order.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top