C
Caburky via AccessMonster.com
Using a tabbed subform - the code below works perfect to validate one field
and force a required value for a second field IF the users tabs through the
fields. However, I'm not sure how to compile the code that gives the user
the option of tabbing or manually selecting each field.
Private Sub ALARM_Q2_REM_Exit(Cancel As Integer)
'if the alarm rate <3 and the rem doesn't have a value then pop a message
'and force the user to stay in the control until it has a value
If (Me.ALARM_Q2_RATE.Value) > 0 And (Me.ALARM_Q2_RATE.Value) < 3 And _
Nz(Me.ALARM_Q2_REM.Value, "") = "" Then
MsgBox "You must enter a value to continue."
Cancel = True
Else
Me.ALARM_Q2_REM.BackColor = 16777215
End If
End Sub
and force a required value for a second field IF the users tabs through the
fields. However, I'm not sure how to compile the code that gives the user
the option of tabbing or manually selecting each field.
Private Sub ALARM_Q2_REM_Exit(Cancel As Integer)
'if the alarm rate <3 and the rem doesn't have a value then pop a message
'and force the user to stay in the control until it has a value
If (Me.ALARM_Q2_RATE.Value) > 0 And (Me.ALARM_Q2_RATE.Value) < 3 And _
Nz(Me.ALARM_Q2_REM.Value, "") = "" Then
MsgBox "You must enter a value to continue."
Cancel = True
Else
Me.ALARM_Q2_REM.BackColor = 16777215
End If
End Sub