MichaelWaimauku
Registered User.
- Local time
- Today, 11:29
- Joined
- Dec 6, 2012
- Messages
- 57
Hi, I'm inserting a report based on the current open record into Outlook email. It all works fine except for a couple of things. If the email is cancelled, an error displays along with the report being left open - due to debugging. (Run-time error '2501': The SendObject action was cancelled). What code can be written to allow the completion if user cancels email (giving message saying, 'Action Cancelled by User' and then closing open report - just as if it was completed sucessfully)?
Private Sub Command25_Click()
Me.Dirty = False
DoCmd.OpenReport "nonconformity", acViewPreview, , "[nonconformid] =" & Me.NonConformID
DoCmd.SendObject acSendReport, , acFormatPDF, Forms![non conformity]![Contact] DoCmd.Close acReport, "NonConformity", acSaveNo
End Sub
Thanks in advance
Private Sub Command25_Click()
Me.Dirty = False
DoCmd.OpenReport "nonconformity", acViewPreview, , "[nonconformid] =" & Me.NonConformID
DoCmd.SendObject acSendReport, , acFormatPDF, Forms![non conformity]![Contact] DoCmd.Close acReport, "NonConformity", acSaveNo
End Sub
Thanks in advance