Maintaining Autonumber Values

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
 
J

John Vinson

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).
 

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