Prevent 0's from printing

  • Thread starter Thread starter Ted
  • Start date Start date
T

Ted

Is there a way on a report to print nothing(blank) if the
value is 0(zero)?

I am printing a column of numbers and some of the values
are 0. Rather than printing the 0, I would prefer that it
just be blank.

Example:
What it does now -
Record Value
1 10
2 300
3 0
4 150
5 0

What I want -
Record Value
1 10
2 300
3
4 150
5

Any guidance is appreciated,
ted
 
Replace the [value] field on your report with a text box containing the
following:

=IIf([Value]=0],"",[Value])


Rick
 
oops...

=IIf([Value]=0,"",[Value])

I had an extra bracket in my first post.

Rick


Rick said:
Replace the [value] field on your report with a text box containing the
following:

=IIf([Value]=0],"",[Value])


Rick



Ted said:
Is there a way on a report to print nothing(blank) if the
value is 0(zero)?

I am printing a column of numbers and some of the values
are 0. Rather than printing the 0, I would prefer that it
just be blank.

Example:
What it does now -
Record Value
1 10
2 300
3 0
4 150
5 0

What I want -
Record Value
1 10
2 300
3
4 150
5

Any guidance is appreciated,
ted
 
Ted said:
Is there a way on a report to print nothing(blank) if the
value is 0(zero)?

I am printing a column of numbers and some of the values
are 0. Rather than printing the 0, I would prefer that it
just be blank.

Example:
What it does now -
Record Value
1 10
2 300
3 0
4 150
5 0

What I want -
Record Value
1 10
2 300
3
4 150
5


I think the easiest way is just set the text box's Format
property to a custom format that prints nothing instead of
zero. This may be sufficient:

#;;""

Try to track down the Help topic on custom formats in your
version of the Help files (start with Format Property ?).
 
That's why Marsh is the MVP!!!



Marshall Barton said:
I think the easiest way is just set the text box's Format
property to a custom format that prints nothing instead of
zero. This may be sufficient:

#;;""

Try to track down the Help topic on custom formats in your
version of the Help files (start with Format Property ?).
 
Thanks for responding. I'm sorry, but I still fight
through writing expressions sometimes.

My [Value] is =Sum([June]), so if I'm understadning your
response the expression look like this:

=IIf(=Sum([June])=0,"",=Sum([June]))

I have tried this a couple of different ways and
continually get a syntax error usually stating that I have
entered a comma without a preceeding value or identifier.

What am I missing?
-----Original Message-----
Replace the [value] field on your report with a text box containing the
following:

=IIf([Value]=0],"",[Value])


Rick



Is there a way on a report to print nothing(blank) if the
value is 0(zero)?

I am printing a column of numbers and some of the values
are 0. Rather than printing the 0, I would prefer that it
just be blank.

Example:
What it does now -
Record Value
1 10
2 300
3 0
4 150
5 0

What I want -
Record Value
1 10
2 300
3
4 150
5

Any guidance is appreciated,
ted


.
 
-----Original Message-----
Ted said:
Is there a way on a report to print nothing(blank) if the
value is 0(zero)?

I am printing a column of numbers and some of the values
are 0. Rather than printing the 0, I would prefer that it
just be blank.

Example:
What it does now -
Record Value
1 10
2 300
3 0
4 150
5 0

What I want -
Record Value
1 10
2 300
3
4 150
5


I think the easiest way is just set the text box's Format
property to a custom format that prints nothing instead of
zero. This may be sufficient:

#;;""

Try to track down the Help topic on custom formats in your
version of the Help files (start with Format Property ?).
--
Marsh
MVP [MS Access]
.
Excellent! Thanks for pointing me in the right direction.
I think this is exactly what I needed to know.
 
My [Value] is =Sum([June]), so if I'm understadning your
response the expression look like this:

=IIf(=Sum([June])=0,"",=Sum([June]))

Lose the IIF. All you need is the conditional format that Marshall gave you
on the field. The Data Source of the field is simply =Sum([June])
The Format of the field is #;;""

Tom Lake
 
Back
Top