I am trying to not allow a user to enter any data into a subform on a form, if a control on the form is null. I've set the focus to be on the control when the form is loaded and then I'm assuming that if I do a Lost Focus event when the user somewhere on the subform, I'll get the message that I want.
What am I missing here? My code is the following:
Private Sub cbo_MonthYearSelect_LostFocus()
If Me.cbo_MonthYearSelect = Null Then
MsgBox "You must select a Month period.", vbOKOnly
Me.cbo_MonthYearSelect.SetFocus
End If
End Sub
Should I be trying to set the code on the gotfocus of the subform? I tried that and that doesn't seem to work either...
Any ideas?
Many, Many thanks in advance...
Carie
What am I missing here? My code is the following:
Private Sub cbo_MonthYearSelect_LostFocus()
If Me.cbo_MonthYearSelect = Null Then
MsgBox "You must select a Month period.", vbOKOnly
Me.cbo_MonthYearSelect.SetFocus
End If
End Sub
Should I be trying to set the code on the gotfocus of the subform? I tried that and that doesn't seem to work either...
Any ideas?
Many, Many thanks in advance...
Carie