Default Field Value

  • Thread starter Thread starter john
  • Start date Start date
J

john

I have a number of fields used to calculate a final total on a form. If any
subform field values have no entry the field will be null, how can I get my
fields to enter 0 if the value is null?

Thanks
John
 
Im not sure i fully understand, I would probably suggest giving them a
default value in the OnOpen Event for the form. Failing that - you need to
change for IsNull on each item and where that returns true use the value 0
instead.

Adrian
 
Set the Default Value of the field to 0.

HTH,
Debbie


|I have a number of fields used to calculate a final total on a form. If any
| subform field values have no entry the field will be null, how can I get my
| fields to enter 0 if the value is null?
|
| Thanks
| John
|
|
 
John,
Not sure what you mean...

Your Numeric fields should have a Default Value of 0.

With this calculation...
Nz(Field1) + Nz(Field2) + Nz(Field3) = Total
if any item is null, it will be considered a 0, and keep the Total
calculation from "failing" due to a null value.
hth
Al Camp
 
Cheers John,

That answers the problem, simply trying to set the default value to 0 is
only any good if you go through the field. As I am getting values from other
from fields the default does not work.

Thanks John
 
Back
Top