Adjust font in textbox

Sess

Registered User.
Local time
Today, 07:20
Joined
Jan 4, 2010
Messages
74
I have hard to please customer so I just need to know if there is a shortcut or some way to adjust the font in all of the textboxes on a form without adjusting their corresponding labels.
And also adjust all of the labels without adjusting the corresponding text boxes.
Right now I am using CtrlA to select all then clicking off what I do not want to adjust and it takes time, specially if the customer comes back and asks for the text to be Bold but only on the labels.
Thank you.
 
You can use the click and drag Marquee select box to select multiple items, or use [Shift] and click to select multiple items that can't be seleted in your Marquee select box.
 
You could also use code to do it if you wanted. You could put this function in a standard module and then just pass the parameter you want and then you never have to make a change again.

Code:
Function SetFontBold(strFormName As String, intTBFontWeight As Integer, intLblFontWeight As Integer)
  Dim ctl As Control
    'Normal = 400
    'Bold = 700
 
   For Each ctl In Forms(strFormName).Controls
       If ctl.Tag <> "Skip" Then
        Select Case ctl.ControlType
           Case acTextBox
                ctl.FontWeight = intTBFontWeight
           Case acLabel
 
                ctl.FontWeight = intLblFontWeight
        End Select
      End If
   Next ctl
End Function

And then you call it by using the Form's OnLoad event:
Code:
  Private Sub Form_Load()
    Call SetFontBold(Me.Name, 400, 700)
End Sub

And then if you have a control which you want to set manually, just include the word

Skip

in the control's TAG property and it will bypass that one.
 
Last edited:
Thank you both for your help to keep my customers smiling or at least a lot less grumpy.
 

Users who are viewing this thread

Back
Top Bottom