PC Review


Reply
Thread Tools Rate Thread

Another Conditional Formatting Question

 
 
tkosel
Guest
Posts: n/a
 
      3rd Nov 2008
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?

 
Reply With Quote
 
 
 
 
Maarkr
Guest
Posts: n/a
 
      3rd Nov 2008
I think you can only identify 3 values for conditional format... you may be
able to do it with code depending on if your field is in a single form,
continuous form, or report. Give us your details on if it's a combo box, etc
also.

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

 
Reply With Quote
 
tkosel
Guest
Posts: n/a
 
      3rd Nov 2008
The field(s) are on a continuous form that is a subform on another form. I
actually want to turn the whole line on the form the same color, but have one
field named "Status" that I can use in the expression used for the
conditional format of all the fields. All of the fields are bound text
boxes. Again, I think I may be out of luck as I think you are correct, only
three conditions are available. Looking for a trick! Thanks.

"Maarkr" wrote:

> I think you can only identify 3 values for conditional format... you may be
> able to do it with code depending on if your field is in a single form,
> continuous form, or report. Give us your details on if it's a combo box, etc
> also.
>
> "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?
> >

 
Reply With Quote
 
Jim Ory
Guest
Posts: n/a
 
      21st Dec 2008
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?
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formatting Question lindsayr Microsoft Excel Misc 7 30th Apr 2008 02:52 AM
Conditional Formatting question jamespg Microsoft Excel Discussion 0 30th Jan 2007 07:11 PM
conditional formatting question buachille Microsoft Excel Discussion 2 6th Apr 2006 09:08 PM
question on conditional formatting Josh Microsoft Excel Worksheet Functions 2 29th Apr 2004 05:51 PM
conditional formatting question Stanton A Hershman @ Work Microsoft Excel Worksheet Functions 1 23rd Mar 2004 05:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:14 AM.