View Full Version : How do I reset Autonumber??


raychoy2k
03-28-2003, 12:03 AM
Hello,

I am using the autonumber type in my table. I have accidentally deleted a few records, but would like to sequencially continue the autonumbering. However, Access just continues from where it left off. I would like to reset the autonumber back to 1. How do I do that?

Rich
03-28-2003, 12:12 AM
Delete all the records and compact the db

Cosmos75
03-28-2003, 12:23 PM
Just curious, Is it important that your autonumber field be sequential?

If it is used as a Primary Key, then it shouldn't matter as the primary key should be meaningless and used only to identify unique records.

If it isn't a primary key, what is it used for? Is it used any any calculations? Or comparisons?

Vassago
03-28-2003, 12:23 PM
You don't have to delete ALL the records. If you compact the database, it will start from the greatest autonumber.

Rich
03-28-2003, 12:58 PM
I would like to reset the autonumber back to 1

Vassago
03-29-2003, 05:47 AM
:p So I'm blind, sue me.

raychoy2k
03-29-2003, 11:52 AM
Thanks but no help yet.

Let me try to be more clear. I only want one of my tables to be reset to 1. I can remove all records if thats necessary. It is a autonumber data type and it is the primary key.

I am storing customer ID with autonumber sequentially. But for some reason, it is starting at 9. I would like it to start back at 1. If I compact the database, will it affect the other tables?

Vassago
03-29-2003, 12:30 PM
Do as Rich mentioned and remove all records. Then compact the database. This will cause the table to start again at 1.

harra
03-29-2003, 12:42 PM
The effect it will have on the other tables is that it will reset all their autonumbers to the next available number. So if you have an empty table, the next available number is 1. If you have a table that has 2059 as the highest autonumber value being used, it will set the next available number to 2060.