Returning Autonumber back to 0

G

Guernsey Gaz

If finished creating and testing a small database. During the testing I used
junk data, I have deleted all the records so that nothing is in the fields
but when I start a new record the Autonumber continues from when I deleted
the old records, what I need is to reset the Autonumber back to 0 so that the
first real record entered is 1

Looking forward to some replies
 
S

Stephen Carr

Guernsey Gaz said:
If finished creating and testing a small database. During the testing I used
junk data, I have deleted all the records so that nothing is in the fields
but when I start a new record the Autonumber continues from when I deleted
the old records, what I need is to reset the Autonumber back to 0 so that the
first real record entered is 1

Looking forward to some replies

Gaz,

As far as I can gather, the whole point of Autonumber is that any new
records remain unique.

Copy the structure to a new table.
Delete the table and rename the copied one to the original name.
Establish table relationships again.
The first new record enter should start at 1.

Backup the whole DB before doing anything.

Hope this helps.

The complex way is probably via Visual Basic modules (Yikes)

Steve
 
D

Douglas J. Steele

Stephen Carr said:
Gaz,

As far as I can gather, the whole point of Autonumber is that any new
records remain unique.

Copy the structure to a new table.
Delete the table and rename the copied one to the original name.
Establish table relationships again.
The first new record enter should start at 1.

Backup the whole DB before doing anything.

Hope this helps.

The complex way is probably via Visual Basic modules (Yikes)

Far more work than necessary, Stephen. No need to copy or anything else:
simply compact after deleting the data from the table.

You're right, of course, that the point of an Autonumber is to provide a
(practically guaranteed) unique value that can be used as a primary key. As
such, it shouldn't matter if you've got 235,236, 238 or 1, 2, 3.
 
T

Terry Kreft

Empty the table and compact the database.

As others have said you should not use Autonumbers to represent something in
th ereal world, there one and only purpose is to create a unique number to
identify the record.
 
Top