J
Jody
I am using the following code to send a report:
This is working in the live application, but I am doing some development on
a copy of the database and I get the following message:
"[MyDatabaseName] can't open the mail session."
I have not done any modifications to this particular bit of code, but this
is the only code that calls for this functionality. Any clue what the
resolution to this error is?
Code:
Private Sub RunReport_Click()
On Error GoTo Err_RunReport_Click
Dim dbCurr As DAO.Database
Dim qdfCurr As DAO.QueryDef
Dim stDocName As String
Set dbCurr = CurrentDb()
Set qdfCurr = dbCurr.QueryDefs("AppendConsumerTable")
With qdfCurr
.Execute dbFailOnError
If .RecordsAffected > 0 Then
DoCmd.SendObject acSendReport, "Replacement_Rpt_Qry2", acFormatSNP,
"[email protected]", , , "Consumer GP Orders Needed", "Please review the
attached document and take the necessary action.", 0
DoCmd.OpenQuery "UpdatePartSentQuery"
DoCmd.OpenQuery "DeleteConsumerTable_qry"
DoCmd.OpenQuery "DeleteInvalidhistoryRecords_qry"
DoCmd.OpenForm "Menu"
DoCmd.CLOSE acForm, "Confirmation"
End If
End With
Exit_RunReport_Click:
Exit Sub
Err_RunReport_Click:
MsgBox Err.Description
Resume Exit_RunReport_Click
End Sub
This is working in the live application, but I am doing some development on
a copy of the database and I get the following message:
"[MyDatabaseName] can't open the mail session."
I have not done any modifications to this particular bit of code, but this
is the only code that calls for this functionality. Any clue what the
resolution to this error is?