I am using WinXP and Access2K2, but should work with your version.
On the form's current event try this:
If me.yourstatusbox = 0 then
me.yourfield.backcolor = RGB(255, 255, 0) 'Yellow
me.yourfield.forecolor = RGB(0, 0, 0) 'Black
Else: me.yourfield.backcolor = RGB(0, 255, 0) 'Green
me.yourfield.forecolor = RGB(255, 255, 255) 'White
End IF
The RGB( 255, 255, 255) designation is for the colors and can be anything
from 0-255 in each case. You will have to play with the numbers to get the
required color combination.
In the Help section of visual basic, search for RGB function. You should
find what basic color numbers are and you can increase or decrease the
numbers for them to display different colors.
Also, look at Backcolor Property for an example of changing text box colors,
etc.
Another thing I found is that you must change each text box back style
property from 'transparent' to 'normal' for the colors to show up.
Here are the basic colors. The numbers are formatted like: RGB(X, X, X)
Black 0 0 0
Blue 0 0 255
Green 0 255 0
Cyan 0 255 255
Red 255 0 0
Magenta 255 0 255
Yellow 255 255 0
White 255 255 255
--
Jim Ory
"tkosel" wrote:
> I hope I have searched enough to NOT have missed the answer that is already
> there, but I don't think so. I have several conditions that need to be
> formatted for.
> When a field value is the # indicated, I want the colors to be as indicated.
>
> 0 = Green text on Light Green
> 1 = Black text on Light Yellow
> 2 = Black text on Gold
> 3 = Black text on Orange
> 4 = White text on Red
>
> I know how to set conditional formating, but am one condition short? Any
> ideas, or what am I missing?
>
|