>Dear All,
>
>I have made a program with a multiple station input say an ‘order’ which will have a unique order number automatically produced by the program once any user choose ‘new’ order. My problem is how could I be able to control this as any user may also opt to cancel or not to continue to process the order input. I want to avoid any order number which were not completed in the table or any order number skipped.
>
>Your advise would be greatly appreciated.
>
>Thanks.
>
>Ed
Assign the number as soon as the record is saved.
Use a transaction, in case something fails. The table that contains your sequence must be part of the transaction.
Explain the users why they don't see the numbers as soon as they create the order:
"Assuming the number is assigned when you start creating an order, we would have the following problem: This system is used by several users, who could use more sequence numbers, after the one assigned to you. If you then cancel the editing, or some other error occurs, we would have 'holes' in the sequence. To avoid having 'holes' in the sequence, the only feasible solution we [the programmers] see is to assign the number only when the order is saved."
HTH,
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)