Fields with zero values

B

Bob Quintal

=?Utf-8?B?VGF5bG9yTGVpZ2g=?=
My form has a calculated field for sales tax. I also have
freight and a subtotal. I need to add these fields. The
formula works fine if I check the taxable box and a dollar
amount is entered for sales tax. If I do not check the
taxable yes/no field and consequently no sales tax is entered,
there is no total amount of the order.

How do I need to change the formula?

Thanks,
embed the salestax expression in your total calculation with the nz
() function.
 
G

Guest

My form has a calculated field for sales tax. I also have freight and a
subtotal. I need to add these fields. The formula works fine if I check the
taxable box and a dollar amount is entered for sales tax. If I do not check
the taxable yes/no field and consequently no sales tax is entered, there is
no total amount of the order.

How do I need to change the formula?

Thanks,
 
J

Jeff Boyce

Taylor

If there is no value in a control, but you are trying to use it "for math",
you are learning that "nulls propogate". In English, if you have an
"unknown" value in a calculation, the results of the calculation are
unknown.

To get around this, if you'd normally be adding a value, you can use:
Nz([YourControl],0)
since adding (or subtracting) zero won't change the outcome.

Note that if you are using this control's value as a factor in
multiplication/division, you'll need to think it through a bit more before
using the Nz() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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