Add records number automatically

R

Roger

I tried the Data Type AUTONUMBER and It is not working the way I want it.
Maybe I am doing something wrong.
I created a Database and I want the next record to come up automatically and
if I need to delete a record, that record number should not be deleted as it
does with AUTONUMBER Datav Field does.
Also, how do I reset to (AUTONUMBER field) 1 after I deleted the records in
the Table. Thank you.
 
D

Douglas J. Steele

You're not doing anything wrong. AutoNumbers do not get reset if you delete
a record. In fact, if you start to create a record and then change your
mind, you still lose the value that would have been assigned to the
AutoNumber field. If you had a large table, you really wouldn't want the
delay that would be caused by renumbering, say,10,000 records when you
deleted record number 2!

Realistically, AutoNumber fields exist for one purpose: to provide a
(practically guaranteed) unique value that can be used as a primary key.
That purpose is served by 3, 8, 9 just as well as by 1, 2, 3. Note, too,
that if you ever replicated your database, the AutoNumber field's New Value
type is changed from Incremental to Random. Bottom line is that if the value
of the AutoNumber field is important to you, you probably shouldn't be using
an AutoNumber field.

As to resetting the value, while it shouldn't matter (see above), if you
delete all data from the table and then compact the database, the seed
number is reset in most versions of Access. You can also check what Allen
Browne has at http://www.allenbrowne.com/ser-26.html
 

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