Code: Select all
If Not IsNull(Me.PID) Then
If IsNull(Me.FirstName) Or IsNull(Me.LastName) Then
MsgBox "First and Last Names are required."
Me.FirstName.Undo
Me.LastName.Undo
Me.FirstName.SetFocus
DoCmd.RepaintObject acForm, "frmPatients"
blnQuit = True
Cancel = True
Exit Sub
End If
End If
Code: Select all
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
blnQuit = False
Exit_cmdClose_Click:
Me.Refresh
If blnQuit Then Exit Sub
DoCmd.Close
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
End Sub