Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Formatting not working

Status
Not open for further replies.

puforee

Technical User
Oct 6, 2006
741
US
I have a form with a combo box to select items. Also on the form is a checkbox (tri-state) named Done. I want the color of the combo box text to turn colors based on the state of the tri-state check box. I actually have about 7 forms with this setup...they all work and change colors as they should based on their respective check boxes. Except for this one

Form the Combo box name: = ComboCACTUS Checkbox name: = Done
Conditional formatting attached to ComboCACTUS: Expression IIf([Done]=Yes,1,0) (sets text of combo to green), Expression IIf([Done]=No,1,0) (sets text of combo to Red), Expression IIf(IsNull([Done]),1,0) (sets text of combo to blue).

The base color of the text shows as black and will not change to any of the above colors no matter what the state of the check box is.

This is done in MS Access 2007/2010. I have also recreated...the issue remains.

I have changed names and that does not help.

Any suggestions?
 
dhookom, I took your advice.
Expression [Done]=True
Expression [Done]=False
Expression IsNull([Done])

This still does not work.

[Done] is a tri state check box control. The table field Done is set to Number. This is the same for all tables that hold a field "Done". And all of the forms with their respective Combo boxes and Done fields work....except this one.

I even tried your suggestion with the expressions for [Done]= -1, and [Done] = 0, null remained the same....still did not work.

Can I provide you with any other information?
 
Duane, I tried attaching the conditional formatting to a text box control on the same form....it works. But, it won't work on the comboBox. S-T-R-A-N-G-E.
 
Yes..I agree it works...on all others...and they are depending on the value of their "Done" tri state boxes. I have even completely created a new Form with new controls...same issue. Could there be something wrong with my naming convention? Or, could there be something restricting the font color change?
 
Are the fonts the same? Are they all triple-state?

I changed my [Done] field to numeric and the check box to triple state and it all works as expected.

I'm at a loss as to what might be different in your form.

Duane
Hook'D on Access
MS Access MVP
 
I am curious why it doesn't work but under the theory somethings are easier to fix than to explain, try adding another combobox that does the same thing and see if the conditional formatting works.

If it does, remove the problem one... If you have the time to compare the properties of the two to see what is different I think we'd all be interested assuming that is the cause.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top