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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Yes and No Check Box - Highlight when checked 1

Status
Not open for further replies.

monkeysee

Programmer
Sep 24, 2002
201
US
Is there a way to either have a yes/no check box highlight or change the 'check' to red when the box is populated with the check?
I would like the check box 'stand-out' so that a user sees it if the value is true.

Thanks again in advance to all the guru's out there!
 
Tried this in Excel's UserForm:

Code:
Option Explicit

Private Sub CheckBox1_Click()

With CheckBox1
    Select Case .Value
        Case False  [green]'Unchecked
            '.ForeColor = vbBlack[/green]
            .BackColor = Me.BackColor
        Case True  [green]'Checked
            '.ForeColor = vbRed[/green]
            .BackColor = vbYellow
    End Select
End With

End Sub


---- Andy

There is a great need for a sarcasm font.
 
Thanks Andy,
Should this work for an Access Form?

I put this in a module in my Access Data Base and it is not triggering the highlight or red. Also I might add that the name of my checkbox is seasonal, which I did change in the coding you provided.

Thanks Again!
Deb
 
I doubt you can change the color of the "check". I would find another solution such as the fore color of the label or draw a box around the check box if checked.

Also, is the form single view or continuous? This would make a huge difference in any solution.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Did you try in Access this (assuming seasonal is the name of your check box)

Code:
Option Explicit

Private Sub seasonal_Click()

MsgBoa seasonal.Value

End Sub

and see what you get in a message box when you set it to Checked / Unchecked


---- Andy

There is a great need for a sarcasm font.
 
Duane, yes it is a single form.

I am open to any other solution, as my goal is to make this check box obvious (if marked) to the user so that it is not overlooked.
 
I would replace the label with a text box which support conditional formatting. Change the control source to something like:
Control Source: ="Your former label caption"
You can then set its background to transparent and no border with the Locked: Yes and Enabled: No.

Then use Conditional formatting with Expression is to set the format to bold and fore color to red when the check box is checked. In my test I used this for the expression:
Expression Is [Checkbox]
Checkbox is the name of my yes/no field.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top