A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

autonumber data type field is skipping numbers



 
 
Thread Tools Display Modes
  #1  
Old October 5th, 2009, 05:58 PM posted to microsoft.public.access.tablesdbdesign
Remi
external usenet poster
 
Posts: 12
Default autonumber data type field is skipping numbers

Not sure why this happened all of a sudden, but my autonumbering field is
skipping numbers. Normally the numbers are generated in integers of one. But
the field skipped from record number 6449 to 6900.
  #2  
Old October 5th, 2009, 07:19 PM posted to microsoft.public.access.tablesdbdesign
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default autonumber data type field is skipping numbers

It can happen. The only thing that an autonumber does is create a new, unique
number if it is also the Primary Key field. It is not guaranteed to be
sequential and often is not. In fact it is very easy to 'burn' an autonumber
by opening up a new record, but not saving it. Just opening up a form in add
mode, for example, burns an autonumber and creates a gap in the numbering.

If you MUST have sequential numbers, you need to do a DMax of that field and
insert it while saving the record in a form. Even this can be a problem if
multiple users are inserting records at the same time.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Remi" wrote:

Not sure why this happened all of a sudden, but my autonumbering field is
skipping numbers. Normally the numbers are generated in integers of one. But
the field skipped from record number 6449 to 6900.

  #3  
Old October 5th, 2009, 10:18 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default autonumber data type field is skipping numbers

On Mon, 5 Oct 2009 09:58:14 -0700, Remi
wrote:

Not sure why this happened all of a sudden, but my autonumbering field is
skipping numbers. Normally the numbers are generated in integers of one. But
the field skipped from record number 6449 to 6900.


That's normal behavior. I'm guessing that you ran an Append query to add data
to the table; that will often leave a large gap like this.

An Autonumber has one purpose, and one purpose ONLY: to provide a meaningless
unique key. They're not guaranteed to be sequential, or free of gaps; they can
even become random (if you Replicate the database, say), giving you 224014225
followed by -312255618 followed by 824512436. Therefore Autonumbers should be
kept "under the hood", concealed from user view, so users won't be tempted to
assign them a meaning which they will not support.
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.