Solved Adding price from multiple tables for a total price for a product (1 Viewer)

slharman1

Member
Local time
Today, 01:30
Joined
Mar 8, 2021
Messages
467
Ok need more help here it is:
I have a product table, and two child tables - product labor price and product parts price. I need to total the price for the product labor table and total the price for the product parts table based on the product table primary key. Then add the total product labor price and the total product parts price together to get a total for the entire product. I can do this on the form for the product table with subforms for both labor and parts.
I first added a calculated field on the subform for each of the multiple labor records related to the product and then totaled those on the subform. Then I did the same for the parts subform. Finally I created a calculated field on the product form and added the labor price and the parts price together to get the total.

Now I have a main quote form that I have a subform with multiple products on but I can't figure put how to get the calculated total for the product from the product form to the quote form.

Any help would be greatly appreciated. Can I just use a calculated field that will be equal to the calculated field on the form?

Thanks in advance for any insight you may have to offer.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:30
Joined
May 7, 2009
Messages
19,169
you need a Detail table for your quotation.
you can use Query as record source of your product subform (on quotation form).

select quotationID, productCode, productName, qty, productLabor.laborcost * qty As LaborCost, productParts.price * qty As Price from quotationDetail;
 

Ranman256

Well-known member
Local time
Today, 02:30
Joined
Apr 9, 2015
Messages
4,339
use the query that arnelgp said,

another way , use a form with tProduct as the master form, and a subform with tProdPrices
the 2 records (labor & Parts) will show. In the subform FOOTER, put the textbox with formula: =sum(Prices)
this will also show you the total price for that product.
 

slharman1

Member
Local time
Today, 01:30
Joined
Mar 8, 2021
Messages
467
I think I asked my question incorrectly.
Thanks for all your help.
 

Users who are viewing this thread

Top Bottom