how to make invoice number?

ariansman

Registered User.
Local time
Today, 01:26
Joined
Apr 3, 2012
Messages
157
I am selling some products, namely A to M. I record the orders of costumers in a table, named "orders". For example, if costumer "Jack" has ordered as the following:
Code:
ID   costumer     product     quantity  unitprice    orderdate

12      jack         A            4        10        25/11/2014
13      jack         B            5         5        25/11/2014
14      jack         C            1         4        25/11/2014
15      jack         F            3         2        25/11/2014
16      Jack         G            4         8        25/11/2014
17      Jack         H            1         7        25/11/2014

Then I make a report based on the above table and issue that as the invoice to the costumer, who is jack here.
How can I make a unique invoice number, which automatically increases sequentially for each invoice? Do I need to add a new column to the table? I also need to be able to look for a specific invoice based on the number, or date.
Thank you
 
the table you show is not the invoice. it's the invoice's items.
Invoices has many legal issues and rules. They are different from one country to the other. You should learn this carefully.

One thing you should remember that invoice can't be changed once it was made. If you take data from linked tables you must save this data into the invoice table.
If you pick items from an Items' table you must save all item data into the invoice. data in Items' table can't be changed but it should never affect the invoice once it was made.

As for numbers you should have an InviceNumber field.
Use DMax()+1 to increment the numbers.
You will probably have to create another table to hold the StartNumber and EndNumber for this.
 
Their is a DEMO in the Sample Databases if you care to use it.
Save as Invoice or Quote. You can simply use a form to set the staring invoice number.

HTH
 
I mean, in the above example, there should be a number, 13896 for example, assigned to orderID from 12 to 17. If another costumer make orders with orderID from 18 to 21, we will have 13897 as the assigned number. how do you think we can do that?
 
Their is a DEMO in the Sample Databases if you care to use it.
Save as Invoice or Quote. You can simply use a form to set the staring invoice number.

HTH

where can i see this demo?
 
that you guys, i think i have lost the subject. i have put a new pots. i appreciate your help.
 
Please don't double post. Best if you go back and delete the other one.
 
is it not possible to use a form with a sub form?
the main form selects the customer this then creates an id number which could be the invoice number
 
Ariansman, did you find a solution? I don't want to muddy the waters by adding my two cents if you already have figured things out.
 

Users who are viewing this thread

Back
Top Bottom