Hoping someone could take a look at my VBA below and tell me why my database is closing even when I select "No" in my message boxes.
This code starts after I run queries and send a report to Excel.
Sub TestMsg()
msg = "File has been exported to Excel, Send Email to Users?"
button = vbYesNo + vbDefaultButton2
response = MsgBox(msg, button)
If response = vbYes Then
Call SendMail
MsgBox "Mail sent, Quit Access?", vbYesNo
If vbYes Then - db closes when I hit "No" too
DoCmd.Quit
ElseIf response = vbNo Then
MsgBox "Quit Access Now?", vbYesNo - Not getting this msg to appear
If vbYes Then
DoCmd.Quit
End If
End If
End If
End Sub
Thanks,
Toni