Conditional formatting--more than 3 conditions?

  • Thread starter Thread starter Fr@nk
  • Start date Start date
F

Fr@nk

Hello. I have a subform displaying as continuous forms,
and use conditional formatting for the text controls to
set the different rows (on the subform) to display in
various colors. The Access GUI to set this conditional
formatting only gives me three conditions on which to
change the formatting. Is there any way in code to give me
another condition or two? I need to add a couple more.

If there's a way of doing this via a VB function, I need
some guidance as to how to point the "Conditional
Formatting" GUI to the function I'd write. Any help is
appreciated. Thanks.

F
 
I just tried this and it appeared to work, but it's kind of a long way
around to do it. It will work for changing the font color, not the back
color (fill).

1) Place a rectangle behind the textbox. Size it the same as the textbox,
set its boarder to transparent, and set its back color to the back color of
the textbox.

2) For the default condition of the textbox, set the fore color the same as
the back color of the rectangle. Set your 3 other conditions to change the
fore color as desired.

3) Set the back style of the textbox to Transparent. If you set the back
style before you set the Conditional Formatting, Access will set the back
style to Normal, so you have to do this AFTER you set the Conditional
Formatting.

4) Place another textbox on top of the first one. Set its default fore color
to match the fill color of the rectangle.

5) Set the next 3 conditional formatting options for the fore color of this
textbox.

6) Set the back style of the 2nd textbox to Transparent.

You should be able to continue doing this for however many textboxes you
need. It did not appear that there is any problem editing this field because
the all of the textboxes are bound to the same field, so when you change
one, you change them all.

This was just a quick test, but it appeared to work. The problem with using
code, and the reason Conditional Formatting was added, is that there is
really only one textbox repeated multiple times on a continuous form, not
multiple textboxes. So, when you change the textbox using code, you change
all of them.
 
Thanks, Wayne. This solution, while extremely confusing to
me, may work. However, I'm not sure I want to go this
route, as maintenance on it will be a bit of a pain (i.e.,
as criteria for my formatting changes).

The other solution you mentioned, from lebans.com, didn't
seem to address my particular problem:

- conditional formatting
- more than three conditions
- displaying on continuous forms, every row/record not
necessarily the same format

At least I couldn't find it inside the lebans.com example.

I'm beginning to believe this limitation can't be worked
around. Thanks again anyway.


F
 
Back
Top