[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 676
  • Last Modified:

DoCmd.SendObject acSendReport

Having trouble with the attached sample.
Based on the conditions in my query, I should get Outlook to send 3 email messages to the three addresses.
Sample.mdb
0
ShawnGray
Asked:
ShawnGray
  • 2
1 Solution
 
Rey Obrero (Capricorn1)Commented:
use this

Private Sub SendEmailCmd_Click()
    Dim response
    response = MsgBox("Send Receipts Now?", vbYesNo, "Bluebook")
    If response = vbYes Then

'On Error GoTo ErrNoEmail
    Dim rs As DAO.Recordset
'    Set rs = CurrentDb.OpenRecordset("PaymentHistoryQryList")
    Set rs = Me.RecordsetClone
    rs.MoveFirst
    Do Until rs.EOF
    DoCmd.SendObject acSendReport, "Collection History All Receipts", acFormatSNP, rs!Email, , , "Test sub", "test msg", , True
    rs.MoveNext
    Loop

'ErrNoEmail:

End If

End Sub
0
 
ShawnGrayAuthor Commented:
Brilliant!  Thank you very much.
0
 
ShawnGrayAuthor Commented:
Hey Cap - I've reposted the question; I didn't realize the event was sending every report to every email person on the list.  
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now