Autonumber Reset

JohnH
3StarLounger
Posts: 287
Joined: 09 Mar 2010, 23:16
Location: Canberra Australia

Autonumber Reset

Post by JohnH »

One of my database stopped working the other day, and the datafile needed a compact and repair. Fortunately that got things going again.

But I found that one critical table no longer had a primary key. The autonumber field was still there, but was no longer the key. I have set it to be the key again.
But the most recent record is numbered 1. There is then a gap to about 55, and the records continue to 75.
I copied the record numbered 1, and did a Paste Append thinking it would become 76, but it just became 2.

What is going to happend when the autonumber reaches 55 again? Will it jump to 76? or start duplicating?

This will take a couple of years, and the records from 55 on will probably have been archived by then.. but I am just wondering.
Regards

John

User avatar
HansV
Administrator
Posts: 78487
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Autonumber Reset

Post by HansV »

Method 2 in MSKB article AutoNumber field is not reset after you compact an Access database provides code to set the AutoNumber seed, for example to 76.
Best wishes,
Hans

JohnH
3StarLounger
Posts: 287
Joined: 09 Mar 2010, 23:16
Location: Canberra Australia

Re: Autonumber Reset

Post by JohnH »

Wonderful! That seems to have worked. I feel much happier about this now.

Thanks.
Regards

John