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