View Single Post
  #4  
Old February 12th, 2010, 12:57 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Filling in voids in the id number

On Thu, 11 Feb 2010 12:33:01 -0800, TES wrote:

My first column is the key and ID number for each record. One of my users
(before I locked the table) voided several of the records, and now the record
number and Id number no longer match. Is there a way to back fill the key-id
number with dummy records so the rows line up.

Thanks……


Ummmm...

You don't want to do that.

An Autonumber has one purpose, and one purpose ONLY: to provide a meaningless
unique identifier.

They are *NOT* "record numbers". They will always have gaps; not only will
deleting a record leave a permanent gap, so will starting to enter a record
and then hitting ESC twice to cancel the entry.

If you want a gapless, sequential number, don't use an Autonumber field at
all; use a "custom counter" (a long integer field with VBA code to assign the
value).

But think about it: do you really want meaningless, dummy records with no data
inserted into your table, just to keep the ID sequential? What benefit does it
serve to do so?
--

John W. Vinson [MVP]