I have some vba performing some conditional formatting. Basic, no frills. I need help to expand what I already have.
Background: I have a textbox (SQ1C) that needs to turn green when option 1 of the option group is chosen, needs to turn red when option 2 is chosen and if option 3 is chosen, it needs to turn yellow AND then prompt the user to enter a remark in another textbox, maybe with a setfocus?
What I am starting with turns the other textbox red if options 2 or 3 are chosen. I have nothing for green. I can't seem to pull it all together.
PLEASE HELP! I am against the clock. The big bosses want color coding.
Here is the code.
SQ2C is the new textbox
SQ2F is the option frame containing 3 options.
SQ2R is the remark field.
Background: I have a textbox (SQ1C) that needs to turn green when option 1 of the option group is chosen, needs to turn red when option 2 is chosen and if option 3 is chosen, it needs to turn yellow AND then prompt the user to enter a remark in another textbox, maybe with a setfocus?
What I am starting with turns the other textbox red if options 2 or 3 are chosen. I have nothing for green. I can't seem to pull it all together.
PLEASE HELP! I am against the clock. The big bosses want color coding.
Here is the code.
SQ2C is the new textbox
SQ2F is the option frame containing 3 options.
SQ2R is the remark field.
Code:
'------------------------------------------------------------
' SQ1
'------------------------------------------------------------
Private Sub SQ2F_AfterUpdate()
If (SQ2F = 2 Or SQ2F = 3) And Len(Me.SQ2R & vbNullString) = 0 Then
Me.SQ2R.BackColor = RGB(255, 0, 0)
Else
Me.SQ2R.BackColor = RGB(255, 255, 204)
End If
End Sub
Private Sub SQ2R_AfterUpdate()
If (SQ2F = 2 Or SQ2F = 3) And Len(Me.SQ2R & vbNullString) = 0 Then
Me.SQ2R.BackColor = RGB(255, 0, 0)
Else
Me.SQ2R.BackColor = RGB(255, 255, 204)
End If
End Sub