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!

Highlight Null Values 1

Status
Not open for further replies.

Baesucks

Programmer
Mar 10, 2008
37
US
I have a text field in my report, I want to create a conditional format so the text field background is RED when the data field value is blank or null. I believe I can do the conditional formula just fine. The problem that I have is even if I set the background to RED for ALL records, each record where that field is blank/null does not seem to show a background for the field at all. All the records where that data field is not null do show the background. Does crystal just not bother to display the field if the value is null? Is there a way to have it display the field anyway (and color it)?
 
Try dropping the field into a text box, and then format the text box with a formula:

if isnull({table.field}) then
crRed else
crNocolor

You can color a text box, but you can't color a field that isn't there.

-LB
 
Is there a way to refer to the report text field rather than the database field in a generic way in the code (so I can use the same set of code for all fields)

Something like... If IsNull(me)... or If IsNull(this)... I tried each of these and it doesn't fly.
 
If you weren't trying to color nulls, you could use currentfieldvalue, but that won't work with a text box.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top