dbTalk Databases Forums  

Can you change the color of a field with an IF STATEMENT ?

comp.databases.filemaker comp.databases.filemaker


Discuss Can you change the color of a field with an IF STATEMENT ? in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
squeed2000@yahoo.com
 
Posts: n/a

Default Can you change the color of a field with an IF STATEMENT ? - 10-02-2005 , 12:45 PM






I want the contents of a field to be displayed in a different color
depending on what the contents are. So if there is a YES I would like
the box to be green. If there is a NO, I would like it to be red. Is
this possible ?

-S


Reply With Quote
  #2  
Old   
Matt Wills
 
Posts: n/a

Default Re: Can you change the color of a field with an IF STATEMENT ? - 10-02-2005 , 01:31 PM






squeed2000 (AT) yahoo (DOT) com wrote on (10/2/2005):

Quote:
I want the contents of a field to be displayed in a different color
depending on what the contents are. So if there is a YES I would like
the box to be green. If there is a NO, I would like it to be red. Is
this possible ?

-S
If you're talking about changing the color of the text, look at the Text
Formatting functions in Help. You can script changes to color, style, etc.

If you want to change the background color:

Create however many global containers you need for the different colors
you want (e.g., BGRed, BGGreen, BGYellow). To populate, draw an object on
a layout using the appropriate fill color, copy it, go to browse mode, and
paste it into the field.

Then create a calculation field returned as a container. Case function
works well here, allowing for more than a single decision:

Highlight =

Case (

DataField = "No" ; BGRed ;

DataField = "Yes" ; BGGreen ;

BGYellow

)

and so on.

Place Highlight on your layout behind, same size as and aligned with
DataField. Make sure DataField's background is transparent.

The highlight field color displayed will be according to the value of
DataField.

You do need to choose the base colors wisely, according to your text
color. Black text shows up great on a bright yellow background, but just
about any other color has to be lighter shade, almost pastel. Black
doesn't show well,for instance, on bright red or green, but white would.

Matt
--



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.