Simple Calculations

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm just trying to do a simple sum of various values (i.e. Field1+Field2+...)
in a form, and when I enter it I do it like I should
=([Field1]+[Field2]+...). When I see the Form in View Mode, the text box is
empty. What am I missing?
 
-----Original Message-----
I'm just trying to do a simple sum of various values (i.e. Field1+Field2+...)
in a form, and when I enter it I do it like I should
=([Field1]+[Field2]+...). When I see the Form in View Mode, the text box is
empty. What am I missing?
.
You need to check for null values for every field. Try
the following:

=iif(isnull(field1),0,field1) + iif(isnull
(field2),0,field2) + etc....
 
Thanks for your help, got it working now!

-----Original Message-----
I'm just trying to do a simple sum of various values (i.e. Field1+Field2+...)
in a form, and when I enter it I do it like I should
=([Field1]+[Field2]+...). When I see the Form in View Mode, the text box is
empty. What am I missing?
.
You need to check for null values for every field. Try
the following:

=iif(isnull(field1),0,field1) + iif(isnull
(field2),0,field2) + etc....
 
You need to check for null values for every field. Try
the following:

=iif(isnull(field1),0,field1) + iif(isnull
(field2),0,field2) + etc....

Wouldn't it be easier and less typing to use the Nz() function?
=Nz(Field1)+Nz(Field2)+Nz(Field3) ...
 
Back
Top