Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click
Dim intResponse As Integer
Dim strPrompt As String
strPrompt = "Are you sure you want to Quit the Database?"
intResponse = MsgBox(strPrompt, vbQuestion + vbYesNo, "My DB Name")
If intResponse = vbYes Then
DoCmd.Quit
Else
Exit_cmdExit_Click:
Exit Sub
Err_cmdExit_Click:
MsgBox err.Description
Resume Exit_cmdExit_Click
End If
End Sub