Yes / No Box

  • Thread starter Thread starter Greg Staley
  • Start date Start date
Greg Staley said:
Is there a way to resize the yes/no box or are we stuck with 1 size?

Are you referring to the check box control on Access forms? If so, you
can't really resize this control, but you can fake one using a text box
with a symbol font such as Wingdings (or any other font that contains a
"check mark" character). I can't recall the details offhand, but I'd
expect you to use a controlsource expression that returns the check mark
character if your yes/no field is true, and a space if it isn't. You'd
also have a Click event procedure for the control that flips the
True/False value of the yes/no field.

If that's not enough to go on, try searching Google Groups for messages
relating to "checkbox resize" in the microsoft.public.access.*
hierarchy.
 
Greg,
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).
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 .. see Note below
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 .. see Note below
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 Check Box 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.

* Note: the above is best used with the label special effects as sunken,
as the check mark chr(252) does not contain the square box around it.
If you use the label as flat, substitute chr(254), which is the square with
the
check mark. Then, you might also wish to substitute the small letter "o"
wherever I have used " " (a space), which will give you the empty box.
 
Back
Top