Conditional formatting of checkbox?

  • Follow


In Access 2003, is conditional formatting possible on a Y/N checkbox?
I have a fairly important checkbox that I would like to highlight in red if 
checked, to grab the user's attention.
If it's not possible, any suggestions for other ways of doing this??
Many thanks
CW 
0
Reply Utf 1/18/2008 8:12:05 PM

On Fri, 18 Jan 2008 12:12:05 -0800, CW wrote:

> In Access 2003, is conditional formatting possible on a Y/N checkbox?
> I have a fairly important checkbox that I would like to highlight in red if 
> checked, to grab the user's attention.
> If it's not possible, any suggestions for other ways of doing this??
> Many thanks
> CW

Check boxes are graphic images and are not resizable nor color
changeable.
What you can do is change the color of the check box label using code,
if you are using Single Form view.
Code the Check Box AfterUpdate event:
If Me.CheckBoxName = True then
   Me.CheckLabelName.BackColor = vbRed
   Me.CheckBoxLabel.ForeColor = vbYellow
Else
   Me.CheckLabelName.BackColor = vbWhite
   Me.CheckBoxLabel.ForeColor = vbBlack
End If

*** Place the same code in the form's Current event. ***

or .... you could place a rectangle around the check box, Send it to
Back, and change it's backcolor using similar code to the above.
-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
0
Reply fredg 1/18/2008 8:33:10 PM


Or you could make a small text box and set the font to windings2 (P will give 
you a tick).  

-- 
Wayne
Manchester, England.



"CW" wrote:

> In Access 2003, is conditional formatting possible on a Y/N checkbox?
> I have a fairly important checkbox that I would like to highlight in red if 
> checked, to grab the user's attention.
> If it's not possible, any suggestions for other ways of doing this??
> Many thanks
> CW 
0
Reply Utf 1/18/2008 9:53:00 PM

Thanks Wayne
CW

"Wayne-I-M" wrote:

> Or you could make a small text box and set the font to windings2 (P will give 
> you a tick).  
> 
> -- 
> Wayne
> Manchester, England.
> 
> 
> 
> "CW" wrote:
> 
> > In Access 2003, is conditional formatting possible on a Y/N checkbox?
> > I have a fairly important checkbox that I would like to highlight in red if 
> > checked, to grab the user's attention.
> > If it's not possible, any suggestions for other ways of doing this??
> > Many thanks
> > CW 
0
Reply Utf 1/19/2008 12:20:00 PM

Thanks Fred, that looks good and I can see myself using that or similar code 
in a number of other scenarios
CW

"fredg" wrote:

> On Fri, 18 Jan 2008 12:12:05 -0800, CW wrote:
> 
> > In Access 2003, is conditional formatting possible on a Y/N checkbox?
> > I have a fairly important checkbox that I would like to highlight in red if 
> > checked, to grab the user's attention.
> > If it's not possible, any suggestions for other ways of doing this??
> > Many thanks
> > CW
> 
> Check boxes are graphic images and are not resizable nor color
> changeable.
> What you can do is change the color of the check box label using code,
> if you are using Single Form view.
> Code the Check Box AfterUpdate event:
> If Me.CheckBoxName = True then
>    Me.CheckLabelName.BackColor = vbRed
>    Me.CheckBoxLabel.ForeColor = vbYellow
> Else
>    Me.CheckLabelName.BackColor = vbWhite
>    Me.CheckBoxLabel.ForeColor = vbBlack
> End If
> 
> *** Place the same code in the form's Current event. ***
> 
> or .... you could place a rectangle around the check box, Send it to
> Back, and change it's backcolor using similar code to the above.
> -- 
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail
> 
0
Reply Utf 1/19/2008 12:21:00 PM

Wayne's suggestion is the way to do it, but you need to do a little work:

1.  Add the real checkbox, bound to the Boolean field in the table, to the 
form and set its Visible property to false.

2.  Add a text box sized to mimic a check box and set its FontName property 
to Wingdings and its ControlSource property to:

=IIf([chkMyBooleanField],Chr(252),"")

where chkMyBooleanField is the name of the hidden real check box.

3.  Use condtional formatting to set the colours of the text box as required 
on the basis of Expresssion Is  [chkMyBooleanField].

4.  Add a button over the text box and set its Transparent property to True, 
and for its Click event procedure use the following code:

    Me!chkMyBooleanField = Not Me!chkMyBooleanField

When the user clicks the pseudo check box text box they will actually click 
the button, which will set the value of the hidden real check box, and hence 
the Boolean column it is bound to.  The expression used as the text box's 
ControlSource property will show it checked or unchecked and the conditional 
formatting will change its colours.

PCW magazine did publish a form of mine showing how this is done, along with 
other formats for pseudo check boxes, but I don't imagine its on their site 
now.  If you want a copy mail me at:

kenwsheridan<at>yahoo<dot>co<dot>uk

Ken Sheridan
Stafford, England 

"CW" wrote:

> Thanks Wayne
> CW
> 
> "Wayne-I-M" wrote:
> 
> > Or you could make a small text box and set the font to windings2 (P will give 
> > you a tick).  
> > 
> > -- 
> > Wayne
> > Manchester, England.
> > 
> > 
> > 
> > "CW" wrote:
> > 
> > > In Access 2003, is conditional formatting possible on a Y/N checkbox?
> > > I have a fairly important checkbox that I would like to highlight in red if 
> > > checked, to grab the user's attention.
> > > If it's not possible, any suggestions for other ways of doing this??
> > > Many thanks
> > > CW

0
Reply Utf 1/19/2008 6:26:00 PM

Ken - that's rather sneaky, and very creative. I will definitely give it a try.
Thanks
CW 

"Ken Sheridan" wrote:

> Wayne's suggestion is the way to do it, but you need to do a little work:
> 
> 1.  Add the real checkbox, bound to the Boolean field in the table, to the 
> form and set its Visible property to false.
> 
> 2.  Add a text box sized to mimic a check box and set its FontName property 
> to Wingdings and its ControlSource property to:
> 
> =IIf([chkMyBooleanField],Chr(252),"")
> 
> where chkMyBooleanField is the name of the hidden real check box.
> 
> 3.  Use condtional formatting to set the colours of the text box as required 
> on the basis of Expresssion Is  [chkMyBooleanField].
> 
> 4.  Add a button over the text box and set its Transparent property to True, 
> and for its Click event procedure use the following code:
> 
>     Me!chkMyBooleanField = Not Me!chkMyBooleanField
> 
> When the user clicks the pseudo check box text box they will actually click 
> the button, which will set the value of the hidden real check box, and hence 
> the Boolean column it is bound to.  The expression used as the text box's 
> ControlSource property will show it checked or unchecked and the conditional 
> formatting will change its colours.
> 
> PCW magazine did publish a form of mine showing how this is done, along with 
> other formats for pseudo check boxes, but I don't imagine its on their site 
> now.  If you want a copy mail me at:
> 
> kenwsheridan<at>yahoo<dot>co<dot>uk
> 
> Ken Sheridan
> Stafford, England 
> 
> "CW" wrote:
> 
> > Thanks Wayne
> > CW
> > 
> > "Wayne-I-M" wrote:
> > 
> > > Or you could make a small text box and set the font to windings2 (P will give 
> > > you a tick).  
> > > 
> > > -- 
> > > Wayne
> > > Manchester, England.
> > > 
> > > 
> > > 
> > > "CW" wrote:
> > > 
> > > > In Access 2003, is conditional formatting possible on a Y/N checkbox?
> > > > I have a fairly important checkbox that I would like to highlight in red if 
> > > > checked, to grab the user's attention.
> > > > If it's not possible, any suggestions for other ways of doing this??
> > > > Many thanks
> > > > CW
> 
0
Reply Utf 1/20/2008 2:28:00 PM

6 Replies
1270 Views

(page loaded in 9.363 seconds)

Similiar Articles:
















7/24/2012 6:54:31 AM


Reply: