I’ve got a database and I’d really like it to be as easy as possible on the end users to export a report in snapshot format, open a new piece of mail from outlook, and attach the report.
I decided to do this using the SendObject command. My code works fine for exporting the report and attaching it to a new piece of mail. My problem is if the user decides NOT to send the message and closes the new mail out then the database generates an error message box explaining the send object didn’t occur and prompts to debug the code.
Basically I’d like someone to look over my code and offer suggestions to disable that message box. I’ve tried to turn off warnings but it had no effect on this particular problem.
Private Sub Button01_Click()
On Error GoTo Err_Button01_Click
DoCmd.SetWarnings False
DoCmd.SendObject acReport, "Rpt_MainReport", "SnapshotFormat(*.snp)", "", "", "", "Testing", "", True, ""
Exit_Button01_Click:
Exit Sub
Err_Button01_Click:
MsgBox Err.Description
Resume Exit_Button01_Click
End Sub
I decided to do this using the SendObject command. My code works fine for exporting the report and attaching it to a new piece of mail. My problem is if the user decides NOT to send the message and closes the new mail out then the database generates an error message box explaining the send object didn’t occur and prompts to debug the code.
Basically I’d like someone to look over my code and offer suggestions to disable that message box. I’ve tried to turn off warnings but it had no effect on this particular problem.
Private Sub Button01_Click()
On Error GoTo Err_Button01_Click
DoCmd.SetWarnings False
DoCmd.SendObject acReport, "Rpt_MainReport", "SnapshotFormat(*.snp)", "", "", "", "Testing", "", True, ""
Exit_Button01_Click:
Exit Sub
Err_Button01_Click:
MsgBox Err.Description
Resume Exit_Button01_Click
End Sub