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!

suppress 0's

Status
Not open for further replies.

MIKElaw

Programmer
Nov 4, 2000
116
GB
I have a report with table fields in the detail section. Depending on the data ranges shown there can be an A4 page of data or a page of 0's with a few figures here and there.
Can I easily stop the 0 printing and just leave it blank???
 
Try:

format([myfield],"#,###")

Mike Pastore

Hats off to (Roy) Harper
 
Had tried v. similar before posting

Get #error# in the column

It's a report via the wizard, No events or anything out of the norm but it appears that anything in the data property which makes it start with an = causes the error to appear

I have tried IIF, FORMAT and others but always the same result hence the post. The field is Currency but tried the same on a Numeric field and still get #error#

Is it me or is it Microsoft?
 
Hit CTL+G,

this should bring up the code window.

Paste:

?format(1234,"#,###")

and press enter.

What happens?

Mike Pastore

Hats off to (Roy) Harper
 
Many thanks for continuing help

Tried the above --- 1234 comes out
#,###0.00 puts the decimal on as 1234.00
Replace 1234 with 0 and you get a blank, just as I suspect you thought it would.

I do have the report as I want it but I had to use the OnFormat event to toggle the .Visible property if the value was 0. Not very elegant, and some 10" of code for each item in the Detail section.
 
Try adding an unbound text box for each zero field you want to suppress. Set its control source to something like this:
Code:
=IIf([YourField]=0,"",[YourField])
 
Cosmo's technique might be best in this situation.

Mike Pastore

Hats off to (Roy) Harper
 
Another suggestion could be that you do a conditional format and make the field white when value = 0.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top