Skipping Auto Numbers

DaniBoy

Registered User.
Local time
Today, 00:22
Joined
Nov 18, 2001
Messages
174
Hello,
I created a small database of two tables, at first I thought that the user was deleting records so I disable the delete event. On the second report I notice that there was still jumps between Autonumbers, I went into the form properties and changed the Record Lock to Yes. Will this fix my problem? I think it will but just want to be sure.:) Is there any way to include those records that were skipped back into the table and just mark them void or something?


Another question, Had any of you had just blank out in access? I dont know what is going on but I cant even make a sense on what tables I need for my new project, everything seems so confusing, Do people get burnout from this? Thats how I feel!! Any susgestions?

Thanks

DaniBoy
 
Sometimes Access shares the autonumber field across tables, so if you create a conact and an address the unique numbers would 1 & 2 respectivley, the next time you add a new contact and address the numbers would be 3 & 4, thus giving you 1 & 3 in your contact table and 2 & 4 in your address table, creating the appearance of the auto number skipping an increment.

It's also posible that you don't have the increment setting applied to you auto number field, you have random number set.
 
Dani, in general it is not a good idea to rely on the properties of the autonumber field other than "Unique." You can never predict what the next number will be, at least not in all cases, even with the plainest of plain vanilla autonumbers.

The culprit here is what happens when someone is about to add a new record but at the last minute cancels the add. The autonumber is allocated already because the recordset has a default action for that field, so when that entry gets cancelled, you "lose" that number.

Stated another way...

When you do an .AddNew to the underlying recordset, THAT is when the autonumber gets updated. If you don't do a .Update afterwards, it doesn't matter. Access DOES NOT CARE that you do a .Cancel rather than a .Update - it was the .AddNew that consumed the next autonumber.
 
Answer 1
Never had Autonumbers dissappear by itself, but on reports they might not show up if your recordset it not displayed for any reason (e.g not meeting criteria)

Answer 2
Yes. Eating your favorite food twice every day will make sick and tired of at one point of time.

Take a break!!!
 

Users who are viewing this thread

Back
Top Bottom