check box conditional formatting

G

Guest

I have a report that has several check boxes which the user has the option of
checking several of the boxes. I want all the options to show but those that
have been checked to appear in a different color... doesn't appear that I can
use typical conditional formatting on this since it is a check box... any
ideas?
 
T

tina

first, are you working with a *report*? or with a form? users can't check
any boxes in a report, it's not interactive.

if you *are* working with a report, you can change the BackColor property
(or the ForeColor) property of the checkbox control's *label* according to
the value of the checkbox, True or False, by adding code to the section's
Format event, as

If Me!LabelName.Parent Then
Me!LabelName.BackColor = vbRed
Else
Me!LabelName.BackColor = vbBlue
End If

substitute another VB constant, or the actual numeric code, of whatever
colors you want to use. also, make sure that the BackStyle property of the
label is set to Normal, not Transparent.

hth
 
M

Marshall Barton

J. Davis said:
I have a report that has several check boxes which the user has the option of
checking several of the boxes. I want all the options to show but those that
have been checked to appear in a different color... doesn't appear that I can
use typical conditional formatting on this since it is a check box... any
ideas?


The graphical image used for a check box (and some other
types of controls) does not support user specified colors,
Personally, I don't thing they look good on paper anyway.

To get what you want, change the check box to a text box
with the expression:
=IIf(yesnofield, "X", "")
and you can set all the colors you want.

If you don't like the way the X looks, change the text box's
FontName property to a font that has a character you do like
and use that instead of the X.
 
G

Guest

Marshall,

I have a form with 10 check boxes.
I saved the form as a report also. The users wanted the information that was
filled out in the form to be emailed to others as a report.
When the report is emailed it becomes a Word Document and the selected check
boxes do not show.
I think the text box solution will work in my report, but I do not
understand where to type in the expression you mentioned below.
=IIf(yesnofield, "X", "")
Where does that expression go?
TIA
Karen
 
M

Marshall Barton

In the report, change the check boxes to text boxes and use
the expression as the text box's ControlSource expression
Change "yesnofield" to the name of the field that was in the
check box's COntrolSource.

Also make sure that the text box is not named the same as
the yesnofield.
 

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