Although I use this technique for a differnet purpose, it might work for you.
- Have a base table that auto enters serial number. Call this table something like "Root Invoice Nos"
- Create a layout that displays data from this table.
- On the layout create a field for the invoice numbers for each of the different types of invoices you have (I assume that these are each on separate tables).
- Create a button on each of your original invoice tables that passes on a unique script parameter for that layout.
- Now attach a script to this button that will switch from original layout, to your new layout. Have it set the Invoice # as a variable. Then have it insert that variable into the field that references to the type of invoice you need which you can.
- a Set Field from calculation and the script variable from a button on the original layout should make this work for you.
If you have FMP Advanced, you can disable the Create New Record when you are on any of these layouts and force users to use the button to create the layout.
This may seem a little Kludgey, but if anyone has a better way to do it, I'd love to know.