Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating inivoice numbers for form

Status
Not open for further replies.
Oct 9, 2004
7
0
0
US
I am trying to create an invoice form. I would like to have a field that gives each invoice a number. I would like to start these numbers with 1800. I already have an autonumber being used on the table, so I am not able to use that function. I need to do it using code. I am calling the field INVOICENUMBER.

The field on the table it is tied to is also called INVOICENUMBER, the table is called "tblHolds_Individuals_BookingTerms".

Any help would be much appreciated
 
Table - tblHolds_Individuals_BookingTerms, create a
field, which you have, called INVOICENUMBER.
Field Name - INVOICENUMBER
Data Type - Numeric
Field Size - Long Integer

Form - in properties of the text box INVOICENUMBER
Default Value, enter =GetInvoice()

Module - create the following:
Pulblc Function GetNexInvoice()
GetNextInvoice=Nz(DMax([INVOICENUMBER]","
[TableName]")+1,+1)

This should hopefully get you started in the correct direction.


An investment in knowledge always pays the best dividends.
by Benjamin Franklin
Autonumber Description - FAQ702-5106
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top