Hidding a Null Value

Vav

Registered User.
Local time
Today, 22:22
Joined
Aug 29, 2002
Messages
36
Hello, got a question.

I have a report that displays three categories.

Prod, Prod/Release, Release....

Only Prod/Release and Release items have a dollar value assigned to them.

(Example of report below:)

Prod Prod/Release Release
P $0.00 $0.00
$12.00 $0.00
$0.00 $43.00
$0.00 $12.00
P $0.00 $0.00


What I want to do is NOT have the $0.00 be displayed. I am asure it is a matter of setting the visible property to false inthe case where the value is NIL.


(Example of what I want the report to look like below:)

Prod Prod/Release Release
P
$12.00
$43.00
$12.00
P

Perhaps I am not on the right track. If i am, the second question is where do i right the code?

Thanks,

Peter Vav
 
Use and IIF statement, that's I I F with two 'I''s. Look it up in your VBA library.

Simply put, you can insert it into the SQL statment of your report, or directly in the textbox on your report in the Control Source property.

=IIF(condition,true result, false result)

=IIF([MyField]=0,"",[MyField])
What the above accomplishes is IF the field [MyField]=0 is True then return "" or an emptystring, else if the field [MyField]=0 is False then return the value of [MyField].
 
You can even return the value of another field and you can also nest IIF statements.

=IIF([MyField1]=0,[MyField2],[MyField1])

=IIF([MyField1]=0,IIF([MyField2]=0, [MyField3], [MyField2]), MyField1])
 
Set the Format property of the control to
$#,##0.00[Black];($#,##0.00)[Black];\0[White] assuming the backround colour of the report is white
 

Users who are viewing this thread

Back
Top Bottom