View Full Version : Autonumber skipping


bevans
06-15-2000, 09:57 AM
I've got a form that multiple users will use to pull up purchase order numbers. It works well with one user, but when someone else has the form open it tends to skip numbers. Also, if someone starts entering data then cancels, the number that would have been assigned is skipped, even though there is no record for that number.
(My numbering is set as an autonumber field incrementing by one.)
Is there any way to avoid this number skipping? Something like a save or update command button?
Anything is fine, code, macros, whatever.

Thanks in advance for your help!

Pat Hartman
06-16-2000, 12:18 PM
There is no way to avoid skipped numbers with an Access generated autonumber. You can build your own function to assign numbers by using the Max() function to retrieve the last assigned number and then incrementing it. The problem with this is that since you have a multi-user app, you could run into the possibility of assigning a duplicate number. You will have to trap for this error and then continue incrementing and attempting to insert until you get to an unassigned number.