Discussion Locked

font change for a control label

0 helpful
11 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am trying to chage the font size of a form control (check box) label and the size of the check box. Only thing aviable to change is the active area.

11 replies

by dklippert

Thanks for asking the question. I found the following code on one of the forums:

"You can't make it bigger but you can work around it.
Here is one method and the coding needed.

Set your actual CheckBoxName.Visible to No.

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.

Code the new Label's Click event:

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

Code the Form Current Event:

Private Sub Form_Current()
If [CheckBoxName] 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 CheckBoxName 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."

by mike476

This work around is for Access. I was refering to Word or Excel.
Sorry for the incomplete question.

by kees.valkenswaard

I am afraid I do not understand your question. Once you have a check box it is very easy to change the font size of the label. Just look in properties and look under font and forecolor. Here you can change to what you want. The only think not possible is to alter the size of the littele square which you would have to check.
Or are we talking about different isues?

by mike476

Yes, I was referring to Excel or Word documents that have controls (check box) that are inserted from the forms toolbar

by mike476

I left out a small detail. I am refering to MS Excel or Word documents with form controls. If you add a check box from the forms toolbar is there a way to change the font size of the labels text?

by kees.valkenswaard

OK. The problem is that you are using the less powerful form controls rather than the controls that you design with the controls toolbox. I was referring to the latter. You should really wonder why using the form controls. I suspect that these are aremainder from previous versions. Now that everything has to be done in VBA, I use the appropriate controls. So, please tell me why the controls should be made as form control with limited capabilities, rather than powerful control from the controlstoolbar.
Good luck.

by mike476

I was trying to fix an old form olrigt and it was eazy until I run into this problem. Thanks for your coment.

This discussion is closed to new replies.