S31
S31

Reputation: 934

Access 2013 - Conditional Formatting for checkboxes

I have a continuous subform in a form that shows several reminders - it has roughly 6 columns, and the last column has checkboxes where you can check it off if the reminder is complete. Is it possible to color the box if the last column is checked?

Upvotes: 3

Views: 5058

Answers (1)

user3305711
user3305711

Reputation: 451

This is a great question! +1! (some people seem to give -1 everywhere)

Conditional formatting is limited to the formatting of text only, so you cant color the check box or its background directly.

Here is a full solution that doesn't even require VBA:

  1. Place a new TextBox over your CheckBox an delete its label
  2. Set it to background so it doesn't cover your CheckBox
  3. Bind that TextBox to the same data field as your CheckBox
  4. Set its font color to white (on white background since you don't want to see the text)
  5. Disable it (since you don't want to enter data here)
  6. Also deactivate it (since you don't even want to place the cursor here)
  7. Now set the Conditional Formatting of this TextBox:
  8. 1st Condition: If equals 0 then set background AND font color to white
  9. 2nd Condition: If equals -1 then set background AND font color to i.e. red

looks great:

enter image description here

Upvotes: 6

Related Questions