I
Iram
Hello.
I am using Access 2003 and I am having problems with a custom error message
box. Besides all of the data entry fields I believe there are two main vba
parts to verify then save the data from the form to the table.
The main VBA is on the "On Error" of the form. I have the following in the
[Event Procdure] not in a module.
Private Sub Form_Error(DataErr As Integer, Response As Integer)
'If an error occurs because of missing data in a required field
'display our own custom error message
Const conErrRequiredData = 3314
If DataErr = conErrRequiredData Then
MsgBox ("Please ensure that you enter a Calwin#, Mult Ref Y/N, CP
FirstN, CP LastN, CP Address Line 1, CP's City, CP's State, CP's Zip, NP's
FirstN, NP's LastN, Is there a Marriage, Children of this relationship and
Interview Notes")
Response = acDataErrContinue
Else
'Display a standard error message
Response = acDataErrDisplay
End If
End Sub
The other vba that I have is in a button that is used to close the data
entry form. In the [Event Procedure] of the On Click of this button I have
the following vba code...
Private Sub CloseDataEntry_Click()
If Me.Dirty Then
Me.Dirty = False
End If
DoCmd.Close
End Sub
However when I click on this button to close the form I still get the
"Run-Time error '3314' The field 'tblQuestionnaire.CP_NameF cannot contain a
Null value because the Required property for this field is set to True. Enter
a value in this field."
I know this is simple to fix. Can you help me fix this?
Iram
I am using Access 2003 and I am having problems with a custom error message
box. Besides all of the data entry fields I believe there are two main vba
parts to verify then save the data from the form to the table.
The main VBA is on the "On Error" of the form. I have the following in the
[Event Procdure] not in a module.
Private Sub Form_Error(DataErr As Integer, Response As Integer)
'If an error occurs because of missing data in a required field
'display our own custom error message
Const conErrRequiredData = 3314
If DataErr = conErrRequiredData Then
MsgBox ("Please ensure that you enter a Calwin#, Mult Ref Y/N, CP
FirstN, CP LastN, CP Address Line 1, CP's City, CP's State, CP's Zip, NP's
FirstN, NP's LastN, Is there a Marriage, Children of this relationship and
Interview Notes")
Response = acDataErrContinue
Else
'Display a standard error message
Response = acDataErrDisplay
End If
End Sub
The other vba that I have is in a button that is used to close the data
entry form. In the [Event Procedure] of the On Click of this button I have
the following vba code...
Private Sub CloseDataEntry_Click()
If Me.Dirty Then
Me.Dirty = False
End If
DoCmd.Close
End Sub
However when I click on this button to close the form I still get the
"Run-Time error '3314' The field 'tblQuestionnaire.CP_NameF cannot contain a
Null value because the Required property for this field is set to True. Enter
a value in this field."
I know this is simple to fix. Can you help me fix this?
Iram