Creating formulas

N

Nexus

how do I create a formula to calculate total amount using
both a control (txtNewQty) and a query?
 
A

Alex Dybenko

in a query you can use Sum(), in control you can use also Sum() - to make
total of some filed of form recordsource, or DSUM() - to sum any table or
query. see online help for more info
 
N

Nexus

I want to multiply qty by price per unit using both the
control and the query together. This is what I've done
and it seems to work but how do I then store the value of
txtTotalPrice into the table with field name TotalPrice?

Private Sub cmdTotalPrice_Click()
txtTotalPrice = (DLookup("[qryToolPrice]!
[ToolPrice]", "qryToolPrice", "[qryToolPrice]![ToolID]='"
& [lstGetToolDetail] & "'")) * txtNewQty
End Sub
 
N

Nexus

I want to multiply qty by price per unit using both the
control and the query together. This is what I've done
and it seems to work but how do I then store the value of
txtTotalPrice into the table with field name TotalPrice?

Private Sub cmdTotalPrice_Click()
txtTotalPrice = (DLookup("[qryToolPrice]!
[ToolPrice]", "qryToolPrice", "[qryToolPrice]![ToolID]='"
& [lstGetToolDetail] & "'")) * txtNewQty
End Sub
 
Top