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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a invoicing system

Status
Not open for further replies.

MrMcFestoe

Technical User
Apr 6, 2003
119
0
0
GB
I need to make myself a simple invoicing system, but i cant understand that if there are more than one item how you get a total for all.

And then store the total and invoice number together.

If that does not make sense i will post agin due to need a day away from this computer, iam going daft with this.

Thanks
 
you use queries and calculated fields on forms and reports in order to do calculations.
it is not good practice to store totals.

you will have a table with unique invoice numbers in it, and related info such as cust name, etc.

in another table, you have for example:

field: InvoiceNumber
field: Item
field: ItemCost

so the data might look like this:

2334221 Green Pants $23.99
2334221 Blue Shirt $15.55
2334221 Red Jeans $56.66
4453001 Orange Vase $35.90

in your RELATIONSHIPS window, you build a "one-to-many" join between your INVOICE table and this second InvoiceItems table. you make the join on the InvoiceNumber.

because of this relationship you make, you can enter data using a SUBFORM. the second (InvoiceItems) table will become a subform embedded in a form which is based on your main INVOICE table. using the Child and Master links, anything you add in the subform will pertain to the Invoice Number you are looking at on the main form.

In queries, you bring in both tables, and the db will put the join in there for you. you write a TOTALS query, bringing down the InvoiceNumber (GROUP BY) and ItemCost (SUM) fields. this way you sum up the costs of all the items for each invoice.

so check HELP for any of the above topics you don't already know. hope this helps!

g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top