Ok one last try and then I'm giving up and sticking with the ugly validation
rule error message.
I removed the validation rule from the table. All fields are set to No for
required.
Here is all of my current code for this form:
Option Compare Database
Private Sub Cancel_Click()
On Error GoTo Err_Cancel_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70 (with this
line I don't get the error messages when cancelling with at least on field
populated, but I do get an error message that says "The command or action
'Undo' isn't available. Without this line I get the required field error
messages before the form closes.)
DoCmd.Close
Exit_Cancel_Click:
Exit Sub
Err_Cancel_Click:
MsgBox Err.Description
Resume Exit_Cancel_Click
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.Caller) Then
DoCmd.CancelEvent
MsgBox "Caller's name is required."
Me.Caller.SetFocus
End If
If IsNull(Me.Date) Then
DoCmd.CancelEvent
MsgBox "Date is required."
Me.Date.SetFocus
End If
If IsNull(Me.Reason) Then
DoCmd.CancelEvent
MsgBox "Reason for call is required."
Me.Reason.SetFocus
End If
If IsNull(Me.Submitter) Then
DoCmd.CancelEvent
MsgBox "Your name is required."
Me.Submitter.SetFocus
End If
End Sub
Private Sub Save_Click()
On Error GoTo Err_Save_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
(without this line I get the required field error messages, but the form
closes. With this line I get the extra error message "No Current Record")
DoCmd.Close
Exit_Save_Click:
Exit Sub
Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click
End Sub
Private Sub Undo_Click()
On Error GoTo Err_Undo_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Exit_Undo_Click:
Exit Sub
Err_Undo_Click:
MsgBox Err.Description
Resume Exit_Undo_Click
End Sub