I have two simple functions on a control; 1 changes the backcolor of the control and requires a value to be input if criteria in another control equals a specific value, and the second to reset the backcolor on exit. My question is this: Is there a way to prevent the user from exiting the control that has the focus if they don't enter a value?
Private Sub ALARM_Q3_REM_GotFocus()
If (ALARM_Q3_RATE) < 3 Then
MsgBox "A rating of 1 or 2 requires remediation. " & _
"Use REM column to indicate method used!", vbOKOnly, "Remeditation Required"
Me.ALARM_Q3_REM.BackColor = RGB(255, 0, 0)
Me.ALARM_Q3_REM.SetFocus
End If
End Sub
Private Sub ALARM_Q3_REM_Exit(Cancel As Integer)
If Not IsNull(Me.ALARM_Q3_REM) Then
Me.ALARM_Q3_REM.BackColor = 16777215
End If
End Sub
Private Sub ALARM_Q3_REM_GotFocus()
If (ALARM_Q3_RATE) < 3 Then
MsgBox "A rating of 1 or 2 requires remediation. " & _
"Use REM column to indicate method used!", vbOKOnly, "Remeditation Required"
Me.ALARM_Q3_REM.BackColor = RGB(255, 0, 0)
Me.ALARM_Q3_REM.SetFocus
End If
End Sub
Private Sub ALARM_Q3_REM_Exit(Cancel As Integer)
If Not IsNull(Me.ALARM_Q3_REM) Then
Me.ALARM_Q3_REM.BackColor = 16777215
End If
End Sub