conditional format pain in the ass

Davros

Registered User.
Local time
Today, 13:39
Joined
Sep 9, 2005
Messages
131
hi
i have a report with a number of fields in the detail section. i would like the back colour of one field to change based on the value of another field. i am using conditional formating with the code below which basically says if the field 'operational risk' is 'low' then turn the text box of another field green:

expression is [operational risk] = "low" (back colour green)
expression is [operational risk] = "medium" (back colour blue)
expression is [operational risk] = "high" (back colour red)

for some reason i cannot fathom it does not work. i thought the code was wrong so i checked and as far as i can make out all the examples i've seen for this simple code are the same format as mine.
any ideas?
thanks
 
Assuming that your control is actually named operational risk, without an Underscore between the two parts, and that it actually resides on the form, your code should work. Does for me, when I duplicate your scenario as given. Even works in an MDE file.

When you say "it does not work,' exactly what do you mean? Does it format incorrectly or simply do nothing?

Also, what Version/SP of Access are you using?

Linq ;0)>
 
rookie mistake
my back style property was set to Transparent instead of normal (which i thought was default?)
code works fine now
thanks anyway
 
Even curiouser! Textbox Back Style, by default, is Transparent, but entering Conditional Formats that change the Back Style normally changes this property to Normal from Transparent!

Glad you got it working, anyway!

Linq ;0)>
 
Even curiouser! Textbox Back Style, by default, is Transparent, but entering Conditional Formats that change the Back Style normally changes this property to Normal from Transparent!
That hasn't been my experience Linq. I've never seen it automatically change when adding conditional formatting. I've always had to go manually change the backstyle to Normal.
 
I just rechecked, Bob, and in 2003/SP2 it does just that! I rechecked it like I did before my original posting.
  • Create a report with the Wizard
  • Backsytle for all textboxes is Transparent.
  • Goto Conditional Formatting for a textbox and set the Backstyle to any color
  • Check the Backstyle and it now says Normal!

The ways of Access are often dark and seldom pleasant!

Linq ;0)>
 
I wish we could keep the background transparent :(
 
thanks for the extra info guys
but it does seem strange in that if conditional formatting is activated then surely the back style should change automatically from transparent to normal?
 
my experience here is the same as Link's - it will change. but it's better to make sure.
I also have a complex form where condional format will work randomaly only.
 

Users who are viewing this thread

Back
Top Bottom