Auto Number Function

  • Thread starter Thread starter Sokki Hong
  • Start date Start date
S

Sokki Hong

Hello,

I've set ID as an autonumber function for the data set I
am entering. The autonumber has been labeling the data
set sequentially as desired, however when I delete a data
point the autonumber function will not reorgnize iself.
For example, if the autonumber was set 1 to 10 for the
first 10 data points and I earase the first data, it'll
start from 2 rather than 1. Any clue on how I can correct
this? Thank you.
 
I was taught that autonumber will never reorganize
itself. If you delete a record it will not effect the
autonumber field. All numbers assigned by the autonumber
function will always stay at the original value.
 
Hello,

I've set ID as an autonumber function for the data set I
am entering. The autonumber has been labeling the data
set sequentially as desired, however when I delete a data
point the autonumber function will not reorgnize iself.
For example, if the autonumber was set 1 to 10 for the
first 10 data points and I earase the first data, it'll
start from 2 rather than 1. Any clue on how I can correct
this? Thank you.

This is how autonumbers are designed to work.

An Autonumber has one purpose, and ONE PURPOSE ONLY: to create an
almost-guaranteed unique key. It is not a count, it is not gapless, it
is not guaranteed to be sequential, and it can even become random.
Therefore, most developers keep them concealed from human view.

Think about it: Suppose you had 223,184 records in your table, linked
to millions of records in other tables. You delete item 2.

Do you really want to change all the other records in all these
tables? Do you want to track down all the printouts and reports and
Post-It notes and brains wherein these numbers are recorded and change
THEM?

If you want a count - count using a Totals query. If you really need a
gapless sequential numeric ID, you'll need to write VBA code to do it.
 
Back
Top