Paul, excuse me for chiming in!
I have already the save function a soon as the invoice No has been created
That wasn't the suggestion. The suggestion was to create the number at the END of the process. This is usually the best method. If it cannot be so, (you might need the number to create child records on a sub form) then enforce a save as soon as the record is started while still allowing further data entry/edits. If this also cannot be, say because a user might change their mind and cancel and you cannot allow gaps in the numbers, then trap the error when you are saving the record. What you should do then I can't say because we don't know enough about the process. That is, do you update the number to the next available one?
One of the more complicated methods inferred might have been to create a temporary value (because child records are required) in temp tables (1 temp table for the main record, 1 for the child records) then update these to the actual value (invoice number) at the time of records saving or form closing and writing the real value to the proper tables. by now, you can probably see why creating the number at the last possible moment is the best method.
Does each user have their own front end, or do you have only one that is being shared?
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.