Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoNumber Fields Changed to Number

Status
Not open for further replies.

CC801340

IS-IT--Management
Jul 10, 2001
147
GB
I have a major problem!

Our access xp database recently corrupted so I had to send it away to
be recovered. Recovery of most records was successful. However, the
ID fields in each table, which were previously of type AutoNumber,
were changed to Number. This meant that data entry was impossible
because in many cases the user didn't enter the ID value.

I need to change the field type back to AutoNumber but WITHOUT losing
the values which are currently in the fields.

Can anyone advise as to the best way to do this?

Many thanks in advance.

Richard
 
This is a quick guess...and if it doesn't work then this won't help at all as it won't lead you anywhere. I had this problem and what I did was add a new field to the table, make the new field an autonumber and then checked to make sure that the numbers were actually matching up with the pre-existing numbers. If that doesn't work then sorry for wasting your time...worked for me, but I just got lucky because no records had been deleted out at that time I think.
 
I have had to do the same thing as godawgs. I had to add dummy records to get the autonumber values in sync then delete them. Good luck. It's a real pain that one.

FW
 
I beleive I exported the records to a new table using a query sorted on the primary key field. Then made an empty copy of the damaged table to get the same fields and settings. Finally I appended the new table's records to the copy and renamed the tables.

It is sort of like appending a StartValue to a table to get the autonumber field set to an arbitary number.

At least this is what I recall doing...

Miranda
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top