August 23, 200718 yr Hi Guys, Quick question, I have a field, let's call it Field A, and this field has text in it. Now, I have another field, Field B. Field B may or may not have text in it. What I want to do is this. If Field B DOES have text of any kind in it, I want the color of the Text in Field A to change to red. I've done this with validation from a drop down list before with other fields, but I cannot get this one to work, all it does it erase what's in Field A instead of updating the color. Here is a sample of the calculation I'm trying. Case ($Field B} = "*" ; TextColor ( Field A ; RGB ( 4 ; 54 ; 255 ))) Any insight or help with the Calculation would be great. Thanks in Advance,
August 23, 200718 yr I don't think validation is the correct tool for this. Define Field A to auto-enter the following calculation: Case ( IsEmpty ( Field B ) ; TextColorRemove ( Field A ) ; TextColor ( Field A ; RGB ( 4 ; 54 ; 255 ) ) ) Uncheck the "Do not replace existing value..." option. P.S. RGB ( 4 ; 54 ; 255 ) is more blue than red.
August 28, 200718 yr Hi Comment, Is there any way to change the color of text for an unstored calculated field depending on it's content? You can't modify with a script and I can't get it by putting a TextColor() statement in the calculation defenition. Edited August 28, 200718 yr by Guest
August 28, 200718 yr "I can't get it by putting a TextColor() statement in the calculation defenition." You should be able to.
August 28, 200718 yr Without even putting in a case statement to change the color yet - the following is always black. Somthing like: Unstored, = TextColor ( GLOBALS::cDateMain + __pk_DateID - 1; RGB ( 5; 10; 255) )
August 28, 200718 yr The field's formatting overrides the calculation. Go back to the source text and remove its text colour, or set it to something other than black as a test (like green).
August 28, 200718 yr You're right. The field format is overwriting it. Not sure what I can do about it. I worked around this by making another calc field that looks up the first and changes the color. A hack, but there's only 50 records. Thanks for your help
August 28, 200718 yr I found out it's because the field is a date type. If you change field to a text, can change color. For a date, NG. Is this a bug?
August 28, 200718 yr No Bug. They only work on text, that is why they call them Text Formatting Functions. HTH Lee
September 6, 200718 yr Author Ok, I've been messing with this and I keep coming to the same issue. The color of "Field A" does change when "Field B" has text or doesn't have text. The only issue is that the text I had in "Field A" is replaced by a huge number, ".468398780781783 and then that numbers color will change. What am I doing wrong?
September 6, 200718 yr What am I doing wrong? Hard to tell from here. Does this work for you? ColorText.fp7.zip
September 6, 200718 yr Is the field a number field, the calculation will only work on text. If is text, then Paste a copy of your calculation, or a mock up or demo of your file. Lee
Create an account or sign in to comment