I have a button on a form that when pressed closes my form and sends a report to email recipients. This works great the first time, but if I reopen my form and try to send it again either nothing at all happens or I get a SendObect error. Should I have something else in the code to clear it?
On Error GoTo Err_cmdSendResolutions_Click
Dim stDocName As String
stDocName = "rptCompleteResolutions"
DoCmd.Close
DoCmd.SendObject acReport, stDocName, acFormatSNP, , , , _
"Subject", "Message"
Exit_cmdSendResolutions_Click:
Exit Sub
Err_cmdSendResolutions_Click:
MsgBox Err.Description
Resume Exit_cmdSendResolutions_Click
On Error GoTo Err_cmdSendResolutions_Click
Dim stDocName As String
stDocName = "rptCompleteResolutions"
DoCmd.Close
DoCmd.SendObject acReport, stDocName, acFormatSNP, , , , _
"Subject", "Message"
Exit_cmdSendResolutions_Click:
Exit Sub
Err_cmdSendResolutions_Click:
MsgBox Err.Description
Resume Exit_cmdSendResolutions_Click