Returning Autonumber back to 0

G

Guest

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
 
G

Guest

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
 
J

Joseph Meehan

Guernsey 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

I suggest you may not want to use Autonumber for that use. Autonumbers
are designed to provide unique numbers. It in not designed to provide
numbers in order and for a number of reasons may not do so. As a result
using them in any application where the user sees the numbers is likely to
end up with confusion.

There are other ways of providing the numbers you want depending on the
particual application.

To reset the autonumber you need to compact the database. I suggest
also doing a repair at the same time.
 
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.
 

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

Similar Threads

Reset Autonumber 2
Autonumber field 5
Autonumber 7
AutoNumber back to 0 9
AutoNumber Field Broken: How To Fix? 9
Autonumber 2
Autonumber trying to create duplicates 3
Re-set autonumber in a table (primary key) 10

Top