What event are you putting this on?
Anyway, I do something like this:
Dim sText As String
If IsNull(Me.txtYourTextBox) or Me.txtYourTextBox = "" Then
sText = "Some value"
Else
sText = Me.txtYourTextBox
End If
Select Case sText
Case "Not Available"
Me.txtYourTextBox.ForeColor = vbRed
Case "Some other value"
Me.txtYourTextBox.ForeColor = vbGreen
Case ...
End Select
Did that help any? You will need to copy and paste this to the On Current event, and the Before Insert and Before Update events on the form.
mmcdonal
|