Hi Guys,
Looking for suggestions to avoid duplicate invoice numbering we are experiencing as system has been introduced to multiple users.
The orders table has an orderID which is the autonumber for the table, however, as the client wants to ensure they have sequential numbering for invoices a field 'invoice' was created and as part of the open form process a new invoice number is created using the following code:
Code:
Forms!frmOrderPlacement!invoice = Nz(DMax("[invoice]", "orders"), 0) + 1
The problem with this is, if another user starts an invoice before the current one is save, the same number can be added to the next invoice, hence there is then duplicated invoice number.
This only happens quite rarely, but often enough to be a nuisance, so if anyone can suggest a better way to handle this I would appreciate it?