-
Insert * <> Colx
Hello,
Here is my challenge:
I want to instert records from table 1 to table 2 using the following code: (Using Access Tables)
db.Execute " Insert INTO [Table2] " _
& "IN """ & OtherDB & """ Select [Table1].* FROM [Table1]"
The problem is that the primary key in these tables is an autonumber field. Help says to exclude the autonumber field if I want it to issue a new number when I insert. How can I exclude the column w/out having to state "Select col1, col2, etc"?
Is this possible?
Any suggestions are greatly appreciated!
-
Carrol,
Firstly, no - you must use Col1, Col2 ... etc.
Secondly, the only way you can actually "enter your own number" is to change the AutoNumber field to a standard (Long) Number field.
You can increment an AutoNumber field, though, by inserting the number you want, minus 1, into the AutoNumber field (a bit messy!).
Any help?