Convert numeric field to Autonumber

C

CMB

Is there a way to convert an existing numeric field to be an autonumber
field? I am converting data and would like to keep the current sequence in
a field but have it autonumber....

Thank you
 
A

Alex Ivanov

You can create an empty table with the autonumber field
and then run an append query into that table.

HTH
 
G

Guest

Yes.

1.Create a new blank table with your field changed from Number to Autonumber.
2.Use VBA code for append old records into new table (use recordsets).You
must sort ascendind older table !
3.If old field (number) have "gap" between record, is necessary to insert
new record into new table WITHOUT Update (use just Add). This will increment
Autonumber field.
4.Delete old table

PS Sorry for my (bad) english...


"CMB" a scris:
 
G

Graham R Seach

1. Copy the table using copy-and-paste. Select [Structure Only] when the
[Paste Table As] dialog is displayed.

2. Create an append query to copy the data (including the numeric field
you're converting to Autonumber) to the new table.

3. Change the numeric field to Autonumber.

That's it! When you add new data to the new table, the next number will be 1
higher than the highest number you had before.

Regards,
Graham R Seach
Microsoft Access MVP
Canberra, Australia
 

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