Color code Yes/No checkbox and text dependent on checkbox

G

Guest

Can you color code a checkbox where if it is checked for a yes than the text
would be boldede and colored in Red? I have tried conditional formatting but
it is greyed out when in Design View and checkbox is selected. I don't have
much knowledge of code I would like to do this without using code. Can this
be done? thank you
 
R

Rick B

In design view, you would highlight the textbox you want to change, then
select conditional formatting. Sounds like you might be trying to
conditional format the checkbox. You want to conditional format the text
field.
 
G

Guest

Conditional formatting does not work for check boxes or labels and check
boxes do not have a back color. What you can do is change the back color of
the label associated with the checkbox.

You would do this in the After Update event of the check box:

Me.MyLableName.BackColor = Iif(Me.MyCheckBoxName = True, vbRed, vbWhite)

This will turn the background of the label red when the check box is checked
and white if it is unchecked.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top