depends on what you are trying to accomplish, but you can use a Select Case statement in the Form's Current Event, as in this example
Private Sub Form_Current()
Select Case Left(txt1, 1)
Case "1"
txt1.ForeColor = vbRed
Case "2"
txt1.ForeColor = vbCyan
Case "3"
txt1.ForeColor = vbGreen
Case "4"
txt1.ForeColor = vbBlue
Case Else
txt1.ForeColor = vbBlack
End Select
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.