Creating Invoice Number

geoffcodd

Registered User.
Local time
Today, 05:36
Joined
Aug 25, 2002
Messages
87
I want to create a customer in invoice numer in the
Format YHN 0000

I have a table which contains details of all created invoices so getting the next invoice number is easy using dmax the problem I have is that if I want to print out 10 invoices out at once they all of the same number as details aren't written to the table until it is printed.

So what I need is a formula around the following

Me.txtInvoice_Number = "YHN " & CLng(dMax("[Invoice_No]", "tblExternal_Recharging_Created_Invoice_Details")) + WHAT EVER THE NUMBER OF THE CURRENT RECORD IS.

Any help appreciated

Thanks
Geoff
 
You can quite easily leave the AutoNumber in your table as it is.

Using a query to create the number you can make a calculated field. Bind the query to your form; never the table.

i.e.

InvoiceCode: "YHN" & Format([Invoice_No], "0000")
 

Users who are viewing this thread

Back
Top Bottom