Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Font For Control . . .

Status
Not open for further replies.

roccorocks

Programmer
Nov 26, 2002
248
US
I am trying to figure out a way to change the font "type" or "color" based off of certain criteria that is contained within the controls Source. For example, if I have a "Critical" value, I would like to have that info show as BOLD or RED. If I have a "Caution" value, would like it to show ast Italics or YELLOW. Thanks.
 
If you are using a continuous form, you might like to look at Conditional formatting. If not, here are a few ideas:
Code:
Private Sub cboCombo_AfterUpdate()
If Me.cboCombo = "Critical" Then
  Me.txtText.FontName = Me.cboFont '"Times New Roman"
  Me.txtText.FontSize = 14
  Me.txtText.BackColor = vbRed
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top