Problem of Auto Numbering for ID field

  • Thread starter Thread starter Dragon
  • Start date Start date
D

Dragon

Hi everybody,

May someone help me to solve the following problem.

I have a table, one field named ID and using Auto Numbering function.
Unfortunately, always in office, someone deletes one or two records that
make numbering ID broken its sequence, i.e. Originally, 1......10, after
deleted, 1...5, 7..8, 10. That make me more trouble, and time to time open
the table, delete the ID field, and re-create one so on and so on.

May someone teach me to use auto run VBA function to refresh or re-
numbering the said ID sequence auto numbering while the program being
closed.

ET1
 
May someone teach me to use auto run VBA function to refresh or re-
numbering the said ID sequence auto numbering while the program being
closed.

No. Because a) it's not possible with an Autonumber and b) It's not
necessary and it's a bad idea. Autonumbers have one function and one
function ONLY: to provide a guaranteed unique key. They are not reused
*by design*; they are also not editable *by design*.

Do you REALLY want to have every ID number change whenever you
legitimately delete a record? If you have relationships from this
table to other tables, do you really want every other table's linking
fields changing whenever you delete a record in the main table? What
do you plan to do with ID numbers that have been printed out, jotted
down on Post-It notes, or embedded in people's minds?

Most developers will use Autonumbers "behind the scenes", concealing
them from user view, in order to provide links between tables.
 
Back
Top