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

Suppressing a label

Status
Not open for further replies.

jhermiz2

Programmer
Dec 2, 2003
62
US
How do I suppress a label based on a field being null / not null.

I have a label that says:

"Description:"
[FIELD]

If FIELD is null I want to suppress it. I tried right clicking on "Description" label and selecting "Format text"
Then on the "Common" tab I clicked the x+2 button (this is crystal 9 btw). It came up with the code window.
I tried this:
Not IsNull({Transports.FIELD})

and I also tried:
IsNull({Transports.FIELD})

And I saved and closed .. and reran the report. It did not suppress it...

Jon
 
What I sometimes do is create a single formula field to hold both the description and the field value. Then I can check if the field value is null or blank,

Code:
If {Transports.FIELD}="" or isnull({Transports.FIELD})) then
 ""
Else
 "Description: " & {Transports.FIELD}
end if





Take Care,

zemp

"Show me someone with both feet on the ground and I will show you someone who can't put their pants on."
 
Perhaps your field isn't actually NULL. You might have an empty string or a space.
Try this:
Code:
IsNull({Transports.FIELD})
OR 
Len(Trim({Transports.FIELD})) = 0

~Brian
 
zemp has the right idea. However, you should ALWAYS do the null checks before you check if the string is empty.

If (isnull({Transports.FIELD}) or {Transports.FIELD}="") then
""
Else
"Description: " & {Transports.FIELD}

 
Yes,

But is this to suppress a label? See I want to suppress the label not the field. I have this problem in 4 different places like so

Descrition:

[DescriptionField]

Function:

[FunctionField]

Assumption:

[AssumptionField]

So I want to suppress Description, Function, Assumption if and only if those fields for each of there sections is null or = ""

???
 
ok you guys were right..yet again :)
you people are flawless ... this might have been my problem from my 75+ replies from my other post. I hope it is!!!!

I will see what happens and let everyone know!

Thanks guys,
Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top