Jump to content

Conditional Text Color in FM5


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

Recommended Posts

  • Newbies

Hello All,

I've searched the forums for any advice on conditional text color formatting, but it seems that this is a new option in FM 7. My question, is there a way to approximate this effect in FM 5?

More specifically, I have a DB (call it DB_one) that will display names on a schedule table using data from DB_two (relationships have all been defined and work properly). I would however like to have these names displayed differently according to specific information from DB_two. If, for instance, DB_two xfield ="foo", then DB_two yfield should appear a different color in DB_one, otherwise default color. DB_two yfield will always appear in DB_one, regardless of xfield. It's just the color that I wish to have affected.

I hope that's clear enough for you, without me having to explain my entire situation in more detail....

Thanks very much.

Travis

Link to comment
Share on other sites

Hi Travis,

You are correct when you say that this is new in v7, since I don't have v7, I can't compare it with the workarounds that have been used since v3.

Here a couple of sites and some files that may help you. When you are at these sites, look around at what else is there, they are great resource. BTW, Ray is known as CobaltSky on the Forums. wink.gif

Text Style By: Steve Murray URL:

http://www.fmfiles.com/tnt11.html

Click to Toggle a Field Text Format By: Ray J. Cologon

Scripting the insertion of coloured/formatted text! By: Ray J. Cologon Both available at URL:

http://www.nightwing.com.au/FileMaker/

HTH

Lee

cool.gif

Link to comment
Share on other sites

I've handled this in FM6, and I believe the same solution should work in FM5. It uses two calculation fields, with different formating applied to each one.

Create a two calculation fields, ColourUpper_c and ColourLower_c. Both should test DB_two for the condition for which you want a coloured entry (e.g. Current date > Invoice date + 30). If the condition is true, set ColourUpper_c = "xfield", otherwise set ColourUpper_C = "". If the condition is true set ColourLower_c = "", otherwise set ColourLower_C = "xfield.

Make both calc fields exactly the same size as your xfield and set to transparent. Select ColourUpper_c and change it's font to the colour you want to see when the test condition is met. Select ColourLower_c and change it's font to the coulour when the text condition is not met. Overlay ColourUpper_c exactly on top of ColourLower_c.

When xfield does not meet the test criteria, ColourUpper_c will be transparent, and the ColourLower_c font will be the first colour. When xfield does meet the test criteria, the ColourUpper_c font will be the second colour, and ColourLower_c will be transparent.

Kirsten Masse

Link to comment
Share on other sites

This topic is 7214 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.