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!

Calculating a total in a form from 2 tables

Status
Not open for further replies.

SirWaldizmo

Programmer
Mar 4, 2002
9
US
Hi...

I have 5 tables.

tblProducts
tblIn
tblOut
tblOrders
tblOrdersDetails

I'm creating a form that will allow entries into tblIn. In this form i would like a textbox to display current inventory via calculation. Logic of calculation as follows..

CurrentInventory = sum(tblIn.quantity) -
(sum(tblOut.quantity) + sum(tblOrders.quantity))

Inputs appreciated.
Thanks
 
Have you tried summing the totals in your query first?
 
Well... i figured i can create a query to pull in the ProductID and Quantitiy for all and compute a subtotal for each table, then create another query to do the final computing based on the three subtotals i just got. This will probably work but i was looking for a cleaner way to do it in forms/vb.
 
Try using your code as an expression in the same query at the end. After you do your summing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top