with the "0" I get zero in my text box.

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

I have the code below, it calculates the sum of many products and gives me a
total. If I put a "0" in my default of the field in the table, I get the
correct results. If I take out the "0" then I get nothing in my total. All
the zeros are just confusing on the report.

Also is there a way to only show the items that have a value in my form? Now
I have all the fields that are empty show on the report also.

Michael

=([RucolaSelvatica]+[LattVerde]+[LattRosso]+[Valeriana]+[Spinacino]+[Misticanza]+[Prezzemolo]+[RucolaaMazzetti]+[Misti]+[4Ruc/4Ver]+[4Val/4Mist]+[4Ros/4Ver]+[4Spi/4Val]+[Ravello]+[Datterino]+[Palinuro]+[Carote])
 
Use Nz() around each item in the sum:
=Nz([RucolaSelvatica],0) + Nz([LattVerde],0) + Nz([LattRosso],0) + ...
 
thank you
michael

Allen Browne said:
Use Nz() around each item in the sum:
=Nz([RucolaSelvatica],0) + Nz([LattVerde],0) + Nz([LattRosso],0) + ...

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Michael said:
I have the code below, it calculates the sum of many products and gives me
a total. If I put a "0" in my default of the field in the table, I get the
correct results. If I take out the "0" then I get nothing in my total. All
the zeros are just confusing on the report.

Also is there a way to only show the items that have a value in my form?
Now I have all the fields that are empty show on the report also.

Michael

=([RucolaSelvatica]+[LattVerde]+[LattRosso]+[Valeriana]+[Spinacino]+[Misticanza]+[Prezzemolo]+[RucolaaMazzetti]+[Misti]+[4Ruc/4Ver]+[4Val/4Mist]+[4Ros/4Ver]+[4Spi/4Val]+[Ravello]+[Datterino]+[Palinuro]+[Carote])
 
Back
Top