Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I eliminate zeros on a report? 4

Status
Not open for further replies.

jnix

MIS
Feb 18, 2002
101
US
I've got a report with a lot of zeros. How do I keep them from printing?
Thanks,
jnix
 
Not sure what you mean. Do you want records with a particular field = 0 to not print, or do you want BLANK to appear in place of 0 whenever that occurs?

Please clarify. "Get it right the first time, that's the main thing..." [wavey]
 
I want blank to replace the zero.
jnix
 
Okay. You need to base your report on a query, if not done so already. For the field that you want to hide the 0's, enter the following expression:

Expr1: IIf([FIELDNAM]=0,"",[FIELDNAME])

Hope this helps.

Jim "Get it right the first time, that's the main thing..." [wavey]
 
Okay. You need to base your report on a query, if not done so already. For the field that you want to hide the 0's, enter the following expression:

Expr1: IIf([FIELDNAME]=0,"",[FIELDNAME])

Hope this helps.

Jim "Get it right the first time, that's the main thing..." [wavey]
 
Okay. You need to base your report on a query, if not done so already. For the field that you want to hide the 0's, enter the following expression as the FIELD value:

Expr1: IIf([FIELDNAME]=0,"",[FIELDNAME])

Hope this helps.

Jim "Get it right the first time, that's the main thing..." [wavey]
 
Jnix,

There are two ways to do this:

1. In the query:
Create a new column and make the field
BlahName:IIf([Field]= 0, "",[Field])
<&quot;BlahName&quot; is any name that you make up to recognize the field, &quot;Field&quot; is the name of the field in the table or query which you want to remove the zeroes from>

Basically, what the expression is doing is saying &quot;if the field's value is equal to zero, then disply an empty string (&quot;&quot;, in other words, BLANK), otherwise, show the value of the field.&quot;

Feel free to change the &quot;&quot; into any string that you would want to use to replace the zeros (such as &quot;none&quot; or whatever)

Then on the report, change the source of the control to this new field (don't forget to change the name of the control so you don't get an error)

2. In the report
Create a new control and set its souce to
IIf([Control]= 0, &quot;&quot;,[Control])
<&quot;Control&quot; is the name of the control that you want to test for zeroes.>
Set the original control's visibility to &quot;No&quot;

I personally like to do these calculations in the query since it is then available to other forms/reports/queries that use it, but you might find that putting it on the report will improve performance.

Good luck,
Heather



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top