Calculated Field in Form

H

HG

I have four separate fields (numbers) in a form that I would like add
together into a total field for cross checking.
The fields would be something like this:
Warehouse1 Warehouse2 Warehouse3 TotalCount

The TotalCount field would be calculated as the first three fields are
entered (first three added together) for reference purposes only.
Is there an easy way to accomplish this. I have tried putting in formula for
TotalCount in through properties, but I keep getting Name# or Error in the
field.
Any assistance would be greatly appreciated
 
K

Klatuu

You can use the Control Source property of TotalCount to do this, because I
know you are not actually storing a calculated value in a field :)
=Nz(Warehouse1,0) + Nz(Warehouse2,0) + Nz(Warehouse3)
 
H

HG

Thank you for the quick response, one question, what does the Nz in your
example represent? And does the ,0 need to be after all the fields added
together? I noticed it was only in the first two.
Thank you again for your help.
HG
 
K

Klatuu

Should be in All 3.
=Nz(Warehouse1,0) + Nz(Warehouse2,0) + Nz(Warehouse3,0)

The Nz function converts a Null value in the variable, field, or control in
the first argument to the value in the second argument if the first argument
is Null. It is necessary because all controls for a new record are Null
unless there is a default value specified. Any value added to Null returns
Null, so you would not see the total until all 3 controls are filled.
Using this method, it converts them to 0 so the addition will work as soon
as a value is entered in any one of the controls.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top