Getting the sum of two fields

rk2002

New member
Local time
Today, 12:06
Joined
Mar 8, 2004
Messages
8
I am trying to calculate the sum of two fields multiplied together in my subform and return it to a bound text box in my main form.

Any suggestion will help. I have already worked out the way to calculate the sum of the two fields by creating a unbound text box in my subform by placing the statement in the control source by i am having trouble returnin the value to the main form.!!!!!!!!
 
The controlsource of your form control can either be an equation where you multiply the two numbers together, or the name of the bound field from your underlying table/query. You can do both in one step.

The easiest solution is to use VBA code to assign a value to the control, and the set the controlsource of the control so it's bound. What code you use depends on how your form works. You want to multiply two numbers together, but do you want to assign the value if none of the two numbers are entered (in which case you'd get Null or zero), or if only one exists (again, do you want Null or zero).

Also, do you have a good reason to store the value of a calculation in your database?
 

Users who are viewing this thread

Back
Top Bottom