Cannot send email error - Multiple recipients

jjake

Registered User.
Local time
Today, 17:09
Joined
Oct 8, 2015
Messages
291
Hello,

I am having a problem with a small work order system i created.

I have an update form [frmworkorderupdate] that i enter data in and click cmdSubmitWO which opens another form [frmwoupdateemail].

Code:
Private Sub cmdSubmitWO_Click()

DoCmd.RefreshRecord

Dim Response As Integer
    Response = MsgBox("Would you like to notify others of this update?", vbYesNo + vbQuestion, "Client Prompt")
If Response = vbYes Then
    DoCmd.OpenForm "frmWOupdateEmail"
Else
    MsgBox "Update Completed successfully"
    DoCmd.Close acForm, "frmworkorderUpdate", acSaveYes

'ADD this line
Cancel = True

End If

End Sub

I select my recipients from the list that i would like to send my update report to [rptstatusupdate] by click cmdOK (Report filters to selected record)

Code:
Private Sub cmdOK_Click()

DoCmd.OpenReport "rptstatusupdate", acViewPreview, , "[WorkOrderID]=" & Me!WorkOrderID

If Me.UpdateJake = True Then
    DoCmd.SendObject acSendReport, "rptstatusupdate", "PDF", "jake@Email.com", , , "Work Order Update", "", False
        End If

If Me.UpdateGreg = True Then
    DoCmd.SendObject acSendReport, "rptstatusupdate", "PDF", "Greg@email.com", , , "Work Order Update", "", False
        End If

If Me.UpdateMike = True Then
    DoCmd.SendObject acSendReport, "rptstatusupdate", "PDF", "Mike@email.com", , , "Work Order Update", "", False
        End If

If Me.UpdateLarry = True Then
    DoCmd.SendObject acSendReport, "rptstatusupdate", "PDF", "Larry@email.com", , , "Work Order Update", "", False
        End If

DoCmd.Close acForm, "frmWorkOrderUpdate", acSaveYes
DoCmd.Close acForm, "frmWOupdateemail", acSaveYes
DoCmd.Close acReport, "rptstatusupdate", acSaveYes

End Sub

But i get an error popping up when the access/Deny screen for outlook comes up that says "Runtime Error '2293' Cannot send this email" But if i close it and try it again it will send the email just fine It's driving me nuts!!! :banghead:

Please help!
 
You should have the recipients in a list box, select 1.
Click the report, from its list box,
Click send btn
Then it's 1 line...

Docmd.sendobject acSendReport lstRpt, PDF, lstTO,,,....
 
You should have the recipients in a list box, select 1.
Click the report, from its list box,
Click send btn
Then it's 1 line...

Docmd.sendobject acSendReport lstRpt, PDF, lstTO,,,....

Can I select more then one recipient at a time using this method?
 
I worked out my issue here. I opened the report first then had the form open to select recipients.
 

Users who are viewing this thread

Back
Top Bottom