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

How do I conditionally change color of data returned from a formula 4

Status
Not open for further replies.

iwm

Programmer
Feb 7, 2001
55
US
My more experienced predecessor has created a formula using case logic. Unfortunately our client would like to change the form so that whenever the formula returns the words "data blank" they appear red while the rest of the formula results remain black.

Below is a segment of that formula:

select Left({RptPersonnelSP;1.optionName}, 3)
case "T13":
"13 (03) – Transferred to another State Agency" + chr(13) + "Agency: " + IIF ({RptPersonnelSP;1.cvAgencyTransferTo} = "", "data blank", {RptPersonnelSP;1.cvAgencyTransferTo}) + chr(13) + "Start Date: " + IIF ({RptPersonnelSPP;1.cvNewAgencyStart} = "Dec 30, 1899", "data blank", {RptPersonnelSP;1.cvNewAgencyStart}) + chr(13) + "*Letter of Resignation*"


When the formula returns the words "data blank" my client would like to see these words in red. Is it possible to change the color of one part of a formula while the rest remains the original color?
Your assistance in this matter is tremendously appreciated.

Thanks,
iwm
 
Hi,
You can format the field with a conditional color based on the contents - use the x*2 button next to the font color option and use something like
Code:
If "data blank" then colorRed else defaultColor
Not at a CR setup so check the help file on using this type of formula for font color.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi,
good catch, I forgot that the test needed the field to compare to.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Change the formula to:

select Left({RptPersonnelSP;1.optionName}, 3)
case "T13":
"13 (03) – Transferred to another State Agency" + chr(13) + "Agency: " + IIF ({RptPersonnelSP;1.cvAgencyTransferTo} = "", "<font color=red>data blank</font color>", {RptPersonnelSP;1.cvAgencyTransferTo}) + chr(13) + "Start Date: " + IIF ({RptPersonnelSPP;1.cvNewAgencyStart} = "Dec 30, 1899", "<font color=red>data blank</font color>", {RptPersonnelSP;1.cvNewAgencyStart}) + chr(13) + "*Letter of Resignation*"

Then format the formula to use HTML text interpretation (format field->paragraph->text interpretation->HTML text).

-LB
 
Ok,this is great! There just one problem. How do I do a carriage return when using html? I was using chr(13). Any suggestions?

Thank you so much!

Ingrid
 
Been a while since I touched HTML, but I believe it's <BR>
 
Everyone,

On behalf of my career, I thank you!

With Great Appreciation,

Ingrid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top