If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: Generate Invoice Number

Hi all,
Need a push in the right direction. I am generating invoice numbers using DMax. Adding 1 to the last invoice number. Very straightforward.
The problem I'm having is that I can't seem to come up with a way to completely control that process.
My thought was to do this on a "New Record" button:

The best way to control or force the entry of the code number, in this case "Invoice Number", unic i suppose, is to generate them in an afterupdate event of a necessary control and the first to be updated, because the invoice number should be the first thing to appear and not the last. For example [Client Number] AfterUpdate or [Supplier Number] AfterUpdate.

Don't make the user to click a button to generate the number, use the existing procedures of the controls instead, or other procedures, like the OnCurrent. The users must only input information in the DB and not be worry of a problems of this nature.

You could use the code in the first control of the tab sequence, so when the user update it the invoice number automaticaly appear.

The type of code i prefer to number the invoices, orders, etc... Is the Date in number format, like this: