When someone enters something in my “SearchForm” that is not in the database, I would like an error message to pop up with the OK and cancel buttons. I need help with adding an cancel button to the no records MsgBox function and to cancel the email opening. I have the OK button but can’t seem to figure out how to get the vbOKCancel in there. I guess I’m just not seeing it. I would like the cancel in there so if it’s a typo, the box will close, the email will not open at all, the SearchForm will reset and they can try their search again.
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There are no records available. Please send all information to RJ to be added. Thank you. When you click on OK, this box will close, and a new email window will open for you."
DoCmd.SendObject acSendNoObject, , , "*** Email address is removed for privacy ***", , , "Information Update To Authorizers Database", "Please add the following information to the Authorizers Database: ", True
Cancel = True
End Sub
My Access files are uploaded to GoogleDrive athttps://drive.google.com/file/d/10h_p9ynL5h4Zs_8iWvbNtqRu_yo75GxV/view?usp=sharing. Just so you are aware, I think my Macro and module are a mess. I also have two cancel buttons on my SearchForm, as I was trying to create a better Cancel macro.
Thank you so much for your time and help.