Suppressing a =sum() field if zero

madcats

Registered User.
Local time
Today, 03:32
Joined
Jun 24, 2005
Messages
36
I have a =sum() field in a footer of a report. I would like to show a blank if the sum is zero. I have searched the forum, and not found a solution. Any help would be appreciated.
 
Create a new text box for example "txtTotal" and use the following As its control source >>> =IIf([YourField]=0,"",[YourField]) where "YourField" is the text box that contains your calculation result. Set the "visible" property of "YourField" to false.
 
Worked like a charm, thanks for your help.
 
Just to throw out an alternative that avoids extra formulas, you can use the format property of the textbox to hide zeros. If you look in help, there are actually 4 sections to the property: the formats for positive, negative, zero, and null values. Setting the third argument to "" would suppress the zero.
 

Users who are viewing this thread

Back
Top Bottom