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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Suppress feild with "$0.00" from Display and Print?

Status
Not open for further replies.

number2

Technical User
Oct 25, 2001
284
US
On a report which serves as an itemized billing statement, how can I suppress feilds which have a value of "$0.00"? In other words, if the value is 0 I don't wish the 0 to appear on display or print out. If the value is not 0, I want it to displ;ay and print. Any ideas?
 
I take it you don't want any information to come up?
Like if John Doe has $0.00 spent you don't want him to even show?

Is the dollar amount coming from one field or are you adding a bunch of fields and just printing the grand total for that person?

Use the query linked to the report.
Putin the dollar amount field "is not Null".
Or you could try <> in the dollar amount field.

 
If you don't want the individual fields that are 0 to appear, put something like this in the On Format event of the detail section:
Code:
If Me.txtAmount = 0 Then
   Me.txtAmount = &quot;&quot;
End If
If you want the entire detail line to be suppressed when the amount is 0:
Code:
If Me.txtAmount = 0 Then
   Cancel = True
End If
 
Thanks Cosmo, it sounds like you what I'm looking to do. I'm in A'97. Where is the OnFormat section?? Should I just code that as an event procedure in After Update?
Thanks!
 
In design view of your report, right-click in an open area of your detail section and select Properties. Click on the Event tab and you'll see On Format. Click in the box and you'll see a button with three dots ... Click that button, select Code Builder and put the above code in there......
 
Does anyone know if Access '97 has the On Format Event? I am unable to find it. Perhaps it is only on Access 2000?
 
Sorry..I see OnFormat only applies to Reports, not to forms. Thanks!
 
In the Format property of the control with the $0.00 place you can dictate what the format for positive, negative, zero and null values by putting in a format separated by semi-colons. Here's a sample:

$0.00;($0.00);;

That would show regular numbers for positive, regular numbers in parentheses for negative and nothing for zero and null values. Look up the format property in help for a more in depth explanation.

HTH Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top