Article ID: 180167
Article Last Modified on 1/22/2007
The field '<tablename>.<fieldname>' can't contain a null value because the Required property for this field is set to True. Enter a value in this field. -or- Field '<tablename>.<fieldname>' can't contain a null value.
Table: Table1
------------------
Field Name: Field1
Data Type: Text
Required: Yes
Field Name: Field2
Data Type: Text
Required: No
Name: CloseForm
Caption: Close Form
If IsNull(Me![Field1]) Then
If MsgBox("'Field1' must contain a value." & Chr(13) & Chr(10) & _
"Press 'OK' to return and enter a value." & Chr(13) & Chr(10) & _
"Press 'Cancel' to abort the record.", _
vbOKCancel, "A Required field is Null") = vbCancel Then
DoCmd.Close
' For Access 2.0 remove the previous line and replace with:
' DoCmd Close
Else
Me![Field1].SetFocus
End If
Else
DoCmd.Close
End If
Table: Table1
------------------
Field Name: Field1
Data Type: Text
Required: Yes
Field Name: Field2
Data Type: Text
Required: No
Name: CloseForm
Caption: Close Form
DoCmd.Close
DoCmd Close
Additional query words: record missing can t
Keywords: kbprb KB180167