I have a subform and I have checks I want to do when the user clicks anywhere off of the subform and I am using OnDeactivate.
The problem is the OnDeactivate won't trigger when I click on the parent form or another subform.
I even tried OnlostFocus and it doesn't work either.
The problem is the OnDeactivate won't trigger when I click on the parent form or another subform.
I even tried OnlostFocus and it doesn't work either.
Code:
Private Sub Form_Deactivate()
' Check to make sure Outcomes is populated
If (IsNull(cmb_Action_Outcome) = True And IsNull(cmb_Action_Taken) = False) Then
MsgBox "Action Outcome is a required field, please choose an Action Outcome."
cmb_Action_Outcome.SetFocus
Exit Sub
End If
' Check to make sure the action taken is populated
If (IsNull(cmb_Action_Outcome) = False And IsNull(cmb_Action_Taken) = True) Then
MsgBox "Action Taken is a required field, please choose an Action Taken."
cmb_Action_Outcome = Null
cmb_Action_Taken.SetFocus
Exit Sub
End If
End Sub