Retain old AutoNumbers in new table

G

Guest

Because of a corrupted database I had to do the "cut and paste" to retrieve
my table records. However this reset all the autonumbers. I need to keep the
autonumbers from the old data. If there are missed numbers it doesn't matter.
Then I want to continue on from the highest number. I have recreated with
table with the autonumbers as numbers, but could not get back to the
"AutoNumber" format.

Hopefully someone can help with this. Thanks, Irene
 
G

Guest

This becomes a little tricky to do. Since you have re-created the table with
the proper numbers, next you will want to copy and paste the table, but
select structure only. Open the new table in design view, and change the
number to an autonumber. Find out the highest autonumber in the data set.
Create an appen queary that will add that number of records to the new table.
You want to make sure the criteria is set for the autonumber field to be
less than Highest number +1, and set some field to a value just to get the
autonumbers needed. Then finally create an update queary to update the
records to match the table you have, and delete any records that are not
needed. Rename the tables as needed. Make sure you back up all the data
before you start.
 

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