Solved

CheckBox Properties change by Event

Posted on 2004-04-08
4
192 Views
Last Modified: 2012-05-04
Is there a way to change the background color of the "box" in the checkbox object based on an event?
0
Comment
Question by:gpotenza
4 Comments
 
LVL 10

Accepted Solution

by:
perkc earned 250 total points
ID: 10785423
I don't believe that checkbox background colors can be changed at all. You could however put a label underneath the checkbox and change the label's color based on an event. You would just need to bring the checkbox to the from to make sure it's on top of the label.

Changing the label's color would be:

Me.LabelName.BackColor = 10079487 ' Numeric value to indicate the color

perkc
0
 
LVL 12

Expert Comment

by:nexusnation
ID: 10785498
I agree with perkc.

You could also go as far as using a label with a bolded X as the checkbox, which toggles the checkbox that would be hidden underneath.

It could be as simple as:

Private Sub label1_Click()
Select Case Me.checkbox
Case True
Me.label1.Caption = "X"
Me.label1.Forecolor = vbGreen
Case False
Me.label1.Caption = ""
Me.lbl1.Forecolor = vbRed
End Select
End Sub

Or, to make it simplier, just use the red and green for off and on, and forget about the label's caption of "X". It would look pretty good too.

Andrew
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question