Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6348 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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,

Posted

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.

Posted (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 by Guest
Posted

"I can't get it by putting a TextColor() statement in the calculation defenition."

You should be able to.

Posted

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) )

Posted

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).

Posted

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

Posted

No Bug.

They only work on text, that is why they call them Text Formatting Functions.

HTH

Lee

  • 2 weeks later...
Posted

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?

Posted

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

This topic is 6348 days old. Please don't post here. Open a new topic instead.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.