T
Tony Williams
Is there any way to change the font of ALL the forms in a database without
the need to edit each control individually?
Thanks
Tony
the need to edit each control individually?
Thanks
Tony
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Tony said:Is there any way to change the font of ALL the forms in a database without
the need to edit each control individually?
Tony Williams said:Sorry Marsh how do I reference the control label?
Thanks
Tony
Tony Williams said:To globally change the label color I've used this
For Each lbl In Forms(doc.Name)
lbl.ForeColor = 16711680
Next lbl
But get error 13 Type Mismatch
What am I doing wrong, it worked with ctl?
Thanks
Tony
Tony said:Thanks Marsh. Having created the procedure, presumably as a module, how do I
then run it when it isn't part of a procedure in a form?
Douglas J. Steele said:Not all controls have a ForeColor property. Try:
For Each lbl In Forms(doc.Name)
If TypeOf lbl Is Label Then
lbl.ForeColor = 16711680
End If
Next lbl
Marshall Barton said:Should not be a reason to do that because the code tries to
set the property for every control that has the property.
--
Marsh
MVP [MS Access]
Tony said:Sorry Marsh how do I reference the control label?
Marshall Barton said:If you want to do different things for different kinds of
controls, then use this kind of logic:
For Each ctl In Forms(doc.Name)
ctl.FontName = "Arial"
Select Case ctl.ControlType
Case acTextBox, acComboBox
ctl.FontSize = 10
ctl.FontBold = True
ctl.BackColor = vbWhite
Case acLabel
ctl.FontSize = 8
ctl.BackColor = RGB(255,220,220) 'pink ;-)
End Select
Next ctl
--
Marsh
MVP [MS Access]
Tony said:Sorry what if I wanted to change just the label colours?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.