Display/print zero when field is blank

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

Guest

I have a report with lots of calculations. I want the calculated field to show zero instead of blank. How do I do this. I am new to Access, I have used Alpha 5 for the last 8 years and in reports it's an easy field format to show zero instead of blank when there is no value.
 
I have a report with lots of calculations. I want the calculated field to show zero instead of blank. How do I do this. I am new to Access, I have used Alpha 5 for the last 8 years and in reports it's an easy field format to show zero instead of blank when there is no value.

Cheryl,
Look up the Nz() function in Access help.
=Nz([FieldName],0)

Always use the Nz() function in the calculation itself as well, to
avoid incorrect results if one of the fields in the calculation might
be null. A value of 125 +a Null field is Null, not 125.
Using Nz() you would get:
125 + Nz([NullField],0) = 125
Hope this is helpful.
 
If you don't want to mess around with control sources, you can set the
format property to show 0 in place of nulls. Check Help on "Format
Property - Numeric..."

--
Duane Hookom
Microsoft Access MVP


to show zero instead of blank. How do I do this. I am new to Access, I
have used Alpha 5 for the last 8 years and in reports it's an easy field
format to show zero instead of blank when there is no value.
Cheryl,
Look up the Nz() function in Access help.
=Nz([FieldName],0)

Always use the Nz() function in the calculation itself as well, to
avoid incorrect results if one of the fields in the calculation might
be null. A value of 125 +a Null field is Null, not 125.
Using Nz() you would get:
125 + Nz([NullField],0) = 125
Hope this is helpful.
 
Back
Top