Hello Hilary,
I am sorry I couldn't explain very well. I attached my example lists. every product have their number. And When i create a new invoice it will be automatically get the last invoice number that belongs product number. For example if i create a new invoice form for "pants" I choice "product number" 5 than press ...