How to multiply two database fields?

Lianne van de W

New member
Local time
Today, 09:36
Joined
Jun 24, 2010
Messages
1
Hello,

I have created a form and I want to multiply two fields with each other and after this put the result in another database field (total field).

I typed in, in the standard value box, the database fields and a * from multiply but nothing happens.

Why is this?

I also want the total field change when one of the to be multiplied fields change. How (where) do I this?

Please help.

Thanks.

Lianne
 
For one thing, You shouldn't be storing calculated fields. Read up on the issue. There are some cases where it is OK, but the general rule is that it shouldn't be done.

That being said, if you have to store the total here is how you go about it.


1. Put your total field on the form, use the expression builder to do the following (assuming that the fields you are multiplying are bound, and that the form is bound to the table with the information):

=[field1]*[field2]

2.In the after update event of each one of those fields put the following:

Code:
Me.ProductFieldNameHere.requery

This is all untested so post back if it doesn't work.
 

Users who are viewing this thread

Back
Top Bottom