Autonumber has skipped a number- why?

lodgey47

Registered User.
Local time
Today, 21:36
Joined
Jul 8, 2005
Messages
15
I have a an 'Orders' table that records order details which has the order number field set as an autonumber. I also have a number of other tables which provide additional details for each particular order (eg Address details, invoice history etc) These each have a 1 to 1 relationship with the 'Orders' table. This has all been working fine for some time but having just added a new order the order number has jump from 10135 to 10137! For some reason it missed out 10136.

Any ideas why and what I need to do? If I create a new table based on the structure of the existing one then append the records to it won't I still have the same problem?

Thanks
 
The AutoNumber is designed for the purpose of attaching a numeric ID to a record to enable links to other tables to be correct.

It shouldn't be used for Invoice numbers.

Col
 
lodgey47 said:
This has all been working fine for some time but having just added a new order the order number has jump from 10135 to 10137! For some reason it missed out 10136.

As Col says, you should NOT be using an Autonumber for anything other than relating tables where another candidate key is not available. The reason for the "some reason it missed out 10136" is because when a new record is opened, the autonumber becomes reserved, until the record is saved or deleted. If deleted, the number is discarded. The autonumber can be seen as a behind the scenes method of identification; if you want something visible you will need to generate your own invoice numbers.
 
Cheers. Given I shouldn't use autonumbers for my order number can access auto generate one some other why? As I already have 100+ orders how will I ensure the order numbers remain the same?
 

Users who are viewing this thread

Back
Top Bottom