Hello again! Once again, I'm stumped! I'm trying to code a form to do conditional formatting based on the value of a text box. My text box is txtSrat, whose value is derived from a function. The function will return either "S1", "S2", "S3", or "S4". I want to highlight each line differently based on the "S*" value. I am currently trying to place the code in my forms OnCurrent event, and will later add it also to the OnChange event. Right now, when I execute the code below, all lines get highligted as if they were "S1" regardless of the value in txtSrat. Your help is greatly appreciated!
Private Sub Form_Current()
Dim intColor As Single
Select Case Me![txtSrat]
Case Is = "S1"
intColor = 13434828
Case Is = "S2"
intColor = 10092543
Case Is = "S3"
intColor = 10079487
Case Is = "S4"
intColor = 13408767
End Select
Me![LIN].BackColor = intColor
Me![SubLIN].BackColor = intColor
Me![Nomen].BackColor = intColor
Me![Rqd].BackColor = intColor
Me![Auth].BackColor = intColor
Me![O/H].BackColor = intColor
Me![PctgFill].BackColor = intColor
Me![txtSrat].BackColor = intColor
Me![Remarks].BackColor = intColor
Me![D/I].BackColor = intColor
Me![ERC].BackColor = intColor
Me![RptDate].BackColor = intColor
Me![UIC].BackColor = intColor
End Sub
Private Sub Form_Current()
Dim intColor As Single
Select Case Me![txtSrat]
Case Is = "S1"
intColor = 13434828
Case Is = "S2"
intColor = 10092543
Case Is = "S3"
intColor = 10079487
Case Is = "S4"
intColor = 13408767
End Select
Me![LIN].BackColor = intColor
Me![SubLIN].BackColor = intColor
Me![Nomen].BackColor = intColor
Me![Rqd].BackColor = intColor
Me![Auth].BackColor = intColor
Me![O/H].BackColor = intColor
Me![PctgFill].BackColor = intColor
Me![txtSrat].BackColor = intColor
Me![Remarks].BackColor = intColor
Me![D/I].BackColor = intColor
Me![ERC].BackColor = intColor
Me![RptDate].BackColor = intColor
Me![UIC].BackColor = intColor
End Sub