Display/print zero when field is blank

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.
 
F

fredg

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.
 
D

Duane Hookom

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.
 

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