print zero for null values in a control in detail section of a rep

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

Guest

I'd like to print zero in the detail section of a report when a null value is
present. My control name is PYA, and I've tried =nz([PYA]) as the control
source but I get a circular reference error when I do that.

thanks in advance,
 
Rename the control so it doesn't have the name PYA
Then set its source to
=Nz([PYA],0)

Or as an alternative, set the control's format to
#,###;-#,###;0;0

If you need decimals you will need to change the first two format to
include decimal portions. For instance to display two numbers after the
decimal point, Use #,###.00



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
John,
I hope you will be able to help me. I have a similar problem. I have a
table with NULL fields that I would like to return zero's on both the table
and the report. The most important place is the report though since that's
what everyone will see. My reports are currently showing blanks and I need
to see the zeros. Can you help?

John Spencer said:
Rename the control so it doesn't have the name PYA
Then set its source to
=Nz([PYA],0)

Or as an alternative, set the control's format to
#,###;-#,###;0;0

If you need decimals you will need to change the first two format to
include decimal portions. For instance to display two numbers after the
decimal point, Use #,###.00



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

I'd like to print zero in the detail section of a report when a null value is
present. My control name is PYA, and I've tried =nz([PYA]) as the control
source but I get a circular reference error when I do that.

thanks in advance,
 
If the control's source is a number field then you can set the control's
format to something like the following.

#,###;-#,###;0;0

There are four sections to the above format.
Section 1 - positive number format
Section 2 - negative number format
Section 3 - zero format
Section 4 - null format

Entering 0 in the format forces a number in that position. If no number
is available for that position then zero is displayed in that position.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


Kay said:
John,
I hope you will be able to help me. I have a similar problem. I have a
table with NULL fields that I would like to return zero's on both the table
and the report. The most important place is the report though since that's
what everyone will see. My reports are currently showing blanks and I need
to see the zeros. Can you help?

John Spencer said:
Rename the control so it doesn't have the name PYA
Then set its source to
=Nz([PYA],0)

Or as an alternative, set the control's format to
#,###;-#,###;0;0

If you need decimals you will need to change the first two format to
include decimal portions. For instance to display two numbers after the
decimal point, Use #,###.00



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

I'd like to print zero in the detail section of a report when a null value is
present. My control name is PYA, and I've tried =nz([PYA]) as the control
source but I get a circular reference error when I do that.

thanks in advance,
 
John Spencer said:
If the control's source is a number field then you can set the control's
format to something like the following.

#,###;-#,###;0;0

There are four sections to the above format.
Section 1 - positive number format
Section 2 - negative number format
Section 3 - zero format
Section 4 - null format

Entering 0 in the format forces a number in that position. If no number
is available for that position then zero is displayed in that position.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


Kay said:
John,
I hope you will be able to help me. I have a similar problem. I have a
table with NULL fields that I would like to return zero's on both the table
and the report. The most important place is the report though since that's
what everyone will see. My reports are currently showing blanks and I need
to see the zeros. Can you help?

John Spencer said:
Rename the control so it doesn't have the name PYA
Then set its source to
=Nz([PYA],0)

Or as an alternative, set the control's format to
#,###;-#,###;0;0

If you need decimals you will need to change the first two format to
include decimal portions. For instance to display two numbers after the
decimal point, Use #,###.00



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================


TomD wrote:
I'd like to print zero in the detail section of a report when a null value is
present. My control name is PYA, and I've tried =nz([PYA]) as the control
source but I get a circular reference error when I do that.

thanks in advance,

What about the opposite - not wanting to print a line if a field in that
line is null?
 
Back
Top