I've done this type of thing before by storing the "last invoice
number used" in a hidden cell, or in a cell that is formatted to
display white font on a white background (that is to say, invisible).
The tricky part is: you need an event or trigger that updates the
invoice number on your form with "last number used plus one", and then
saves the new number as last number used. I have successfully used a
print macro to do this.