I am now using the code below, but it still gives me problem, if the user cancels and goes to the previous record, that there is still a record there with an incorrect order number.
I can make the function delete the offending record, but that is a bit drastic and makes users feel odd when...