npaadmin Posted August 23, 2007 Posted August 23, 2007 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,
comment Posted August 23, 2007 Posted August 23, 2007 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.
nick_jp Posted August 28, 2007 Posted August 28, 2007 (edited) 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, 2007 by Guest
Vaughan Posted August 28, 2007 Posted August 28, 2007 "I can't get it by putting a TextColor() statement in the calculation defenition." You should be able to.
nick_jp Posted August 28, 2007 Posted August 28, 2007 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) )
Vaughan Posted August 28, 2007 Posted August 28, 2007 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).
nick_jp Posted August 28, 2007 Posted August 28, 2007 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
nick_jp Posted August 28, 2007 Posted August 28, 2007 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?
Lee Smith Posted August 28, 2007 Posted August 28, 2007 No Bug. They only work on text, that is why they call them Text Formatting Functions. HTH Lee
npaadmin Posted September 6, 2007 Author Posted September 6, 2007 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?
comment Posted September 6, 2007 Posted September 6, 2007 What am I doing wrong? Hard to tell from here. Does this work for you? ColorText.fp7.zip
Lee Smith Posted September 6, 2007 Posted September 6, 2007 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now