Sizing Check Box

  • Thread starter Thread starter JamesJ
  • Start date Start date
J

JamesJ

Not important but why am I unable to size a check box?
Maybe one can't.
I'm want to make it larger than it currently is displayed.

Thanks,
James
 
Not important but why am I unable to size a check box?
Maybe one can't.
I'm want to make it larger than it currently is displayed.

Thanks,
James

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
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.
 
Got the label to display the checks but when I uncheck
one record they all become uncheck and visa versa.

James

fredg said:
Not important but why am I unable to size a check box?
Maybe one can't.
I'm want to make it larger than it currently is displayed.

Thanks,
James

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
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.
 
Got the label to display the checks but when I uncheck
one record they all become uncheck and visa versa.

James

fredg said:
Not important but why am I unable to size a check box?
Maybe one can't.
I'm want to make it larger than it currently is displayed.

Thanks,
James

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
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.

You are using a continuous form?
Controls, such as labels, command buttons, etc., that are not bound to
a field in a table work differently on continuous forms than they do
in single form view.

In single form view, you only see one record at a time and the label
gets redrawn each time you move to a different record. In continuous
view, instead of a different instance of the control for each record,
it is the same control, repeated, and so the label, which is not bound
to a particular field, displays the same for each record. You can see
this for yourself by clicking on the record selector bar to select a
record, then using the down (or up) arrow key to move from record to
record. The label (repeated for all the records) will show the check
box value of whatever the current record is.

Use this large check box only with a Single View form.
 
Ok. Thanks,
James

fredg said:
Got the label to display the checks but when I uncheck
one record they all become uncheck and visa versa.

James

fredg said:
On Mon, 12 Jul 2004 19:47:25 -0400, JamesJ wrote:

Not important but why am I unable to size a check box?
Maybe one can't.
I'm want to make it larger than it currently is displayed.

Thanks,
James

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
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.

You are using a continuous form?
Controls, such as labels, command buttons, etc., that are not bound to
a field in a table work differently on continuous forms than they do
in single form view.

In single form view, you only see one record at a time and the label
gets redrawn each time you move to a different record. In continuous
view, instead of a different instance of the control for each record,
it is the same control, repeated, and so the label, which is not bound
to a particular field, displays the same for each record. You can see
this for yourself by clicking on the record selector bar to select a
record, then using the down (or up) arrow key to move from record to
record. The label (repeated for all the records) will show the check
box value of whatever the current record is.

Use this large check box only with a Single View form.
 
James,

You may be able to do the same thing using a textbox instead of a label. Set
the textbox's Locked property to Yes. Use conditional formatting to change
the value of the textbox based on the value of the checkbox. The conditional
formatting will work on a continuous form.

To do this, set the Control Source of the textbox to

=Chr(252)

In the Conditional Formatting, set the fore color of the textbox to match
the back color as the default. For the first condition, set it to an
expression and type in the name of the field or control (ex. [FieldName]),
set the condition to turn the fore color to black or whatever you want the
text to be. There will always be a check mark in the textbox, but it will
only be visible when the checkbox is true. The rest of how this was done
using a label should still work.

--
Wayne Morgan
Microsoft Access MVP


JamesJ said:
Got the label to display the checks but when I uncheck
one record they all become uncheck and visa versa.

James

fredg said:
Not important but why am I unable to size a check box?
Maybe one can't.
I'm want to make it larger than it currently is displayed.

Thanks,
James

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
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.
 
** snipped **

James,
Wayne Morgan's reply got me to rethink this for use on continuous
forms.
I assume you wish to use the larger check box for entering and
changing data as well as just displaying the larger check mark.

Wayne suggested locking the control, which won't work for you if you
wish to change the actual CheckBoxField value.

Try it this way.
You need Access 2000 or newer (with conditional formatting).

Add an Unbound TEXT control to the continuous form in place of the
[CheckBoxField].

Set it's control source to
= chr(252)
Set it's FontSize to a large enough size
Set it's FontStyle to Wingdings
Set it's ForeColor to White (or whatever the Backcolor is).
Locked property No.
BackStyle property to Normal

Code it's Click event

[CheckBoxField] = Not [CheckBoxField]

Set the control's Conditional Formatting for Condition1 to:
Expression Is
Set the expression to
[CheckBoxField] = True
Set the Condition1 Forecolor to Black

That should be all you need.
After opening the form, resize the control around the check mark if
needed.

You can click on the large check and it will change the actual check
box value.

Use your regular check box field when needed for criteria, counting,
etc. as the new control value is always = chr(252).

I hope this helps.
 
Back
Top