2002 Access - want to delete the autonumbers for deleted records

B

Bonnie

I've created and tested a database for another user. Then I deleted the 36
records I used to test it with. My problem is when the employees tries to
enter new records, the autonumber starts at 37. I want it to start at 1. How
do I do that?
 
M

M Skabialka

Compact the database, this sets autonumbers back to the next number after
the last one used (or 1 if there are no records)
OR
Make a copy of the table, rename the old one then make the new one the
original table name. It will start counting at 1.

Mich
 
J

John Vinson

I've created and tested a database for another user. Then I deleted the 36
records I used to test it with. My problem is when the employees tries to
enter new records, the autonumber starts at 37. I want it to start at 1. How
do I do that?

Autonumbers have one purpose, and one purpose ONLY: to provide an
(almost) guaranteed unique ID.

They will ALWAYS have gaps, are not guaranteed to be sequential, and
can become random (if you replicate the database for instance).

Generally, you should NOT display the value of an autonumber to users
at all. It should be kept "under the hood" as an internal value for
linking tables. If you need a sequential, gapless number, you'll need
to use a Long Integer field and populate it using VBA code; this can
get pretty complex if you want to reuse the values for deleted records
though!

John W. Vinson[MVP]
 
B

Bonnie

Wow, another great answer! The first answer allowed me to fix my problem, and
now yours will keep me from having to try to train users NOT to change an
auto number when inputting data.
 
B

Bonnie

Excellent advise! Tried it and it worked the first time.

I've decided to use these programs efficiently, a person either needs to do
it ALL THE TIME or hand it off to someone else! About the time I get good at
it, I don't have to use it for another year and everything has changed!
--
Thanks,
Bonnie


M Skabialka said:
Compact the database, this sets autonumbers back to the next number after
the last one used (or 1 if there are no records)
OR
Make a copy of the table, rename the old one then make the new one the
original table name. It will start counting at 1.

Mich
 
Top