You could make it a public function inside a module so then you can use it on any form.
Code:
Public Sub BoldLabels(frm As Form, Txt As String)
Dim ctl As Control
'loop through controls collection
For Each ctl In frm.Controls
'you are only interested in labels
If TypeOf ctl Is Label Then
'reset font first
ctl.Font.Bold = False
'check if text is matching label's caption
If InStr(1, LCase(ctl.Caption), LCase(Trim(Txt))) > 0 Then
ctl.Font.Bold = True
End If
End If
Next ctl
End Sub
' search form1 & form2
BoldLabels Form1, Text1.Text
BoldLabels Form2, Text1.Text
'search all forms with "Label1" and make bold
Code:
Dim i As Integer
For i = 0 To Forms.Count - 1
BoldLabels Forms(i), "Label1"
Next i