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

Problems Calculating Fields (i.e. HOW?)

Status
Not open for further replies.

smspeace

IS-IT--Management
Feb 21, 2002
6
GB
Dear All,
Seems to be another thread about calculating fields but i hope you arn't all too bored by them to answer! I'm creating an invoicing database. I have created 5 tables and their structures are below;

Client(Client_ID; Name Address etc...)
Invoices{Invoice_ID;Client_ID; Date, Total Price IncVAT, Total PriceExVAT)
InvoiceInformation(Invoice_ID;Product_ID;Quantity, Price IncVAT, PriceExVAT)
Product/Services(Product_ID;Manufacturer_ID, Supplier_ID,Product_TypeID
Description,Unit Price IncVAT, Unit Price ExVAT)
Manufacturer(Manufacturer_ID; Name, Address etc)
Supplier(Supplier_ID; Name, Address etc)
Prodcuct/ServiceTypes(Product_TypeID;Product_Type)

I've input all the prices for the products and services into that table. I have created a form which has the CLIENT, INVOICE and INVOICE INFORMATION tables in it (the latter two as subforms/tables). How do i get it to calculate "PriceIncVAT" in InvoiceInformation from "Unit Price IncVAT" in Products/Services x "Quantity" in InvoiceInformation ?
Similarly how do i get "Total Price IncVAT" in Invoices to be the sumtotal of all the "PriceIncVAT"s in InvoiceInformation.....

Probably very simple, hope you can understand what i've written aove. Thanks in advance all..

Ali
 
You should not store calculated values in your tables. These should be calculated on demand where and when needed. For example, if you'd like to show a total for your invoice on your form then add an unbound control to sum for you and display this in either the subform's header/footer or you could hide this control on the subform and then call it from another unbound control for display on the mainform. Just make sure you use the full path to the control.

=Forms!MainFormName!SubFormName!ControlName
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top