G
Guest
I need to make a field manditory on a form. I changed the SQL database to
not allow nulls and refreshed and relinked, I've even tried recreating the
query and form but the user still can exit the form without entering data.
This code asks the user to enter data but they can still close the form
without entering the data.
Any suggestion on making this a manditory field to close the form?
Private Sub cmdClose_Click()
On Error GoTo Err_cmdclose_Click
If IsNull(Me.ICNSR) Then
MsgBox ("Please enter a code.")
DoCmd.CancelEvent
End If
DoCmd.close
Exit_cmdclose_Click:
Exit Sub
not allow nulls and refreshed and relinked, I've even tried recreating the
query and form but the user still can exit the form without entering data.
This code asks the user to enter data but they can still close the form
without entering the data.
Any suggestion on making this a manditory field to close the form?
Private Sub cmdClose_Click()
On Error GoTo Err_cmdclose_Click
If IsNull(Me.ICNSR) Then
MsgBox ("Please enter a code.")
DoCmd.CancelEvent
End If
DoCmd.close
Exit_cmdclose_Click:
Exit Sub