I have a form that calculates the total cost. It also as an option to revoke the transaction. The code used is below:
=DSum("Cost","tblTransactions","OrderID = " & [ID] & " AND Revoked = False")
I have since added in the option to Discount a product. It writes back to the same table but I can not work out how to edit the code so it calculates the sum correctly.
New fields on table:
Discounted – Yes/No
Discount – Number
I have used this method before:
Cost*(100-[Discount])/100
But how do I put it all together so I get the correct calculation.
=DSum("Cost","tblTransactions","OrderID = " & [ID] & " AND Revoked = False")
I have since added in the option to Discount a product. It writes back to the same table but I can not work out how to edit the code so it calculates the sum correctly.
New fields on table:
Discounted – Yes/No
Discount – Number
I have used this method before:
Cost*(100-[Discount])/100
But how do I put it all together so I get the correct calculation.