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!

Give the invoicenumber a specific number

Status
Not open for further replies.

firsttime

Technical User
Oct 1, 2002
22
0
0
NL
Hi,

I have a box (record) called 'invoicenumber'. I want it to show: 'aaa.bb.cc'

aaa(a number)= it start at 1 and add up everytime a new order is made
bb(a number)= it shows the KlantId(CustomerId)
cc(a number)= it start at 1 and add up everytime the same customer is chosen.So when the number is 3 it means that it is the third time that the specific customer made an order

Example:
the form look like this (like the order form from Northwind:
Mainform
--------------------------------------------
Bill to: [KlantID](name) Ship to: [Shipname]
Address Address

[OrderID] [Invoicenumber]

Subform
----------------------------------------------
Productname Quantity Price Total
-----------------------------------------------

So the invoice should look like this the first time
invoicenumber:001.01.01

I hope that i explained it wel

THX IN ADVANCE

Dan
 
aaa makes it unique. If you have the orders in a table by customerID, you have all the makings. Just count the order records for the customer in question and make your number. Do not store it anywhere. it is
NUMstr = format(autonumberID,"000000") & "."
NUMstr = NUMstr & format(custID,"00000") &"."
NUMstr = NUMstr & format(dcount("orders","ordTable", CID = ...))

rollie@bwsys.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top