Maintaining Autonumber Values

  • Thread starter Thread starter dbarnas
  • Start date Start date
D

dbarnas

Hi,

I have imported a table into a new mdb and I wish to change the ID field
(Primary Key) to an autonumber field but I am not able to.

I created a new field and set it as an autonumber field but it did not
sequence my records with the same numbers as the ID field.

I would like to create an autonumber field with the same sequence of numbers
as the imported tables ID field had because a number of other tables use
this primary key as a foreign key and so I need to maintain the
relationship.

Any suggestions on how to accomplish this?

Thanks.

Dave
 
Hi,

I have imported a table into a new mdb and I wish to change the ID field
(Primary Key) to an autonumber field but I am not able to.

I created a new field and set it as an autonumber field but it did not
sequence my records with the same numbers as the ID field.

I would like to create an autonumber field with the same sequence of numbers
as the imported tables ID field had because a number of other tables use
this primary key as a foreign key and so I need to maintain the
relationship.

Any suggestions on how to accomplish this?

You can do so by creating a new, empty table with an Autonumber field;
run an Append query from the imported table into this new table,
appending the ID to the Autonumber field. The existing data will be
copied into the autonumber field (this is in fact the only way to set
an Autonumber to a chosen value rather than autoincrementing it).
 
Back
Top