I'm back again!
I have three mandatory fields. I have some code against the Before_Update part of the form, and while the msgboxes are appearing, when I click on the OK, rather than making the user go back to complete the field, the form closes.
Can someone tell me what I'm doing wrong?
I want them to have to fill all three fields out before the form can be saved, or else leave the form without saving.
I thought I had this one sussed!
I have three mandatory fields. I have some code against the Before_Update part of the form, and while the msgboxes are appearing, when I click on the OK, rather than making the user go back to complete the field, the form closes.
Can someone tell me what I'm doing wrong?
I want them to have to fill all three fields out before the form can be saved, or else leave the form without saving.

I thought I had this one sussed!
Private Sub Form_BeforeUpdate(Cancel As Integer)
' Check mandatory field Summary
If IsNull(Summary_Cause) Or Summary_Cause = "" Then
MsgBox "Please fill the Summary Field", vbOKOnly + vbDefaultButton1, "Missing Data"
Me.Summary_Cause.SetFocus
Cancel = True
Exit Sub
End If
' Check mandatory field Details
If IsNull(Cause_of_Problem) Or Cause_of_Problem = "" Then
MsgBox "Please fill the Details Field", vbOKOnly + vbDefaultButton1, "Missing Data"
Me.Cause_of_Problem.SetFocus
Cancel = True
Exit Sub
End If
' Check mandatory field Action/Ideas
If IsNull(Action_Comments) Or Action_Comments = "" Then
MsgBox "Please fill the Action/Ideas Field", vbOKOnly + vbDefaultButton1, "Missing Data"
Me.Action_Comments.SetFocus
Cancel = True
Exit Sub
End If
End Sub