change font size

  • Thread starter Thread starter mcnews
  • Start date Start date
M

mcnews

how can i change font size in a text box based on content? say if
txtWell1.Text = "POSITIVE CONTROL" for example?

tia,
mcnewsxp
 
Dim ctl As Control
For Each ctl In Me.Controls
If (ctl.ControlType = acTextBox) Then
If InStr(ctl.Value, "CONTROL") > 0 Then
ctl.FontSize = 10
End If
Next ctl
 
how can i change font size in a text box based on content? say if
txtWell1.Text = "POSITIVE CONTROL" for example?

tia,
mcnewsxp

Code the Format event of whatever section of the report the control is
placed in, i.e. Detail Format event:

If Me.[txtWell1] = "POSITIVE CONTROL" then
Me.[txtWell1].Fontsize = 14
Else
Me.[txtWell1].Fontsize = 10
End If

Note: In Access it's the Value property, not the Text property, that
you need to check. As Value is the default property, there is no need
to expressly write it.
 
Back
Top