Check Box Control

  • Thread starter Thread starter Diane
  • Start date Start date
D

Diane

Has anyone ever tried to change the size or properties of
a Check Box in a form? I wanted to make the actual
checkmark larger.

Doesn't look as though it's an option in properties.

Thanks,
Diane
 
Yes, I think we've all tried. The built in control won't do it. There may be
some third party controls that will, I don't know.
 
I would think that if Stephen Lebans doesn't have something on his website
about it, then it's probably not possible. Maybe this will be a friendly
challenge to him to see what he can come up with..<g>
 
While it's true (as the others have told you) that you can't change the size
of the built-in checkbox, you can simulate a larger one.

Create a label, and set its font to WingDing, at whatever size you want (try
14 to start). Set the BackStyle property to Normal, the BackColor property
to White, the SpecialEffect property to Sunken, and the BorderStyle property
to Solid. To have it checked, set its Caption to Chr$(252). To have it
unchecked, set it to vbNullString ("")

Put code in the label's OnClick property to toggle between Chr$(252) and
vbNullString.

Unfortunately, this approach doesn't work for continuous forms, due to the
fact that in a continuous form, Access has just one set of control
properties for all of the records displayed. You can use a text box instead,
though, setting its properties the same as outlined above.
 
Diane,

No it's not possible to resize the checkbox itself, but here is a great
work-around from MVP FredG:

Here is the coding needed.

Add an unbound label to the form detail section.
Set its Caption to "o" (small letter "o")
Set it's Font to WingDings
Set it's font size to whatever you want (perhaps 24)
Place this label where you wish to see the check mark.
I've named it LabelLargeCheck.
Set the actual CheckBox.Visible to No.

Code the Label's Click event:

Private Sub LabelLargeCheck_Click()
[CheckBox] = Not ([CheckBox])
If CheckBox Then
LabelLargeCheck.Caption = Chr(254)
Else
LabelLargeCheck.Caption = "o"
End If
End Sub

Code the Form Current Event:

Private Sub Form_Current()
If [CheckBox] Then
LabelLargeCheck.Caption = Chr(254)
Else
LabelLargeCheck.Caption = "o"
End If
End Sub

If you want a CheckBox field label then just add another unbound label and
set its caption to the CheckBox field name. Leave it Visible.

Don't forget to change the name of the CheckBox in this coding to whatever
your Checkbox field is.
That should do it.

Clicking on the new Label is equivalent to clicking on the CheckBox field
itself.


the "world-famous" MVP FredG:

Can't make it bigger but you can work around it.
Here is the coding needed.

Add an unbound label to the form detail section.
Set its Caption to "o" (small letter "o")
Set it's Font to WingDings
Set it's font size to whatever you want (perhaps 24)
Place this label where you wish to see the check mark.
I've named it LabelLargeCheck.
Set the actual CheckBox.Visible to No.

Code the Label's Click event:

Private Sub LabelLargeCheck_Click()
[CheckBox] = Not ([CheckBox])
If CheckBox Then
LabelLargeCheck.Caption = Chr(254)
Else
LabelLargeCheck.Caption = "o"
End If
End Sub

Code the Form Current Event:

Private Sub Form_Current()
If [CheckBox] Then
LabelLargeCheck.Caption = Chr(254)
Else
LabelLargeCheck.Caption = "o"
End If
End Sub

If you want a CheckBox field label then just add another
unbound label and set its caption to the CheckBox field
name. Leave it Visible.

Don't forget to change the name of the CheckBox in this
coding to whatever your Checkbox field is.
That should do it.

Clicking on the new Label is equivalent to clicking on the
CheckBox field itself.
 
Has anyone ever tried to change the size or properties of
a Check Box in a form? I wanted to make the actual
checkmark larger.

Doesn't look as though it's an option in properties.

Thanks,
Diane

Diane,
You can't make it bigger but you can work around it.
Here is the coding needed.

Set your actual CheckBoxName.Visible to No.

Add an unbound label to the form detail section.
Set its Caption to " " ( a space)
Set it's Font to WingDings
Set it's font size to whatever you want (perhaps 24)
Place this label where you wish to see the check mark.
Set it's special effects to Sunken (if you want).
Set it's BackColor to White (or another color if you want).
I've named it LabelLargeCheck.

Code the new Label's Click event:

Private Sub LabelLargeCheck_Click()
[CheckBoxName] = Not ([CheckBoxName])
If [CheckBoxName] = True Then
LabelLargeCheck.Caption = Chr(252)
Else
LabelLargeCheck.Caption = " " ' a space
End If
End Sub
==========
Code the Form Current Event:

Private Sub Form_Current()
If Me.CheckBoxName = True Then
LabelLargeCheck.Caption = Chr(252)
Else
LabelLargeCheck.Caption = " " ' a space
End If
End Sub
===========

If you want a CheckBox field label then just add another unbound label
and set its caption to the CheckBox field name. Leave it Visible.

Don't forget to change the name of the CheckBoxName in this coding to
whatever your Checkbox field is.

After you open the form and use the check box label,
re-adjust the font size if needed, and the size of the label,
to square it around the check mark.
That should do it.

Note: because it's a label now, you can also change it's color, if you
want.

Clicking on the new Label is equivalent to clicking on the CheckBox
field itself.
 
Back
Top