Primary key numbers dissapeared

  • Thread starter Thread starter Shazza
  • Start date Start date
S

Shazza

My database has juest been set up and the numbering (set to autonumber) has
jumped from record no 236 - 3665 As far as i am aware nobody has deleted
records and the database has not been tampered with. can anyone please
explain why this would happen
 
Try a compact/repair.

If that doesn't work, you probably need to apply a service pack to your
version of Office and also to the JET 4 database engine. Get both from:
http://support.microsoft.com/sp

You can programmatically set the Seed of the AutoNumber. Here's some code
the will run through all your tables and check them:
http://allenbrowne.com/ser-40.html
Note that if your database is split (with attached tables), you need to run
this on the back end (the database that actually has the tables in it.)
 
hi,
My database has juest been set up and the numbering (set to autonumber) has
jumped from record no 236 - 3665 As far as i am aware nobody has deleted
records and the database has not been tampered with. can anyone please
explain why this would happen
An incrementing autonumber in Access/Jet is not necessarily without gaps.
The incrementing autonumber only gives you a greater number than the
last one (as a unsigned integer, but as they are always signed a flip to
negatives will happen at 2^31-1).

If you need a running number for any purposes you must generate it by
your self, e.g.

Private Sub Form_BeforeUpdate(Cancel As Integer)

Me![runningNumber] = Nz(DMax("runningNumber", "yourTable"), 0) + 1

End Sub


mfG
--> stefan <--
 
Back
Top