When I run the following code with all entries made the routine asks me twice if I want to save. Can someone tell me why? Other than that, it seems to run correctly.
Private Sub btnSaveRecord_Click()
If IsNull([Active]) Then
MsgBox “You must make an entry in the ‘Active’ box”
[Active].SetFocus
ElseIf IsNull([FirstName]) Then
MsgBox “Enter First Name please.”
[FirstName].SetFocus
ElseIf IsNull([LastName]) Then
MsgBox “Enter Last Name please.”
[LastName].SetFocus
ElseIf IsNull([StartDate]) Then
MsgBox “Enter Start Date please.”
[StartDate].SetFocus
ElseIf MsgBox(“Are you sure you want to save?”, vbYesNo) = vbNo Then
Me.Undo
Else: DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close acForm, “frmMembersEntry”, acSaveYes
End If
End Sub