Stacey1306
Technical User
Hello,
I have created a membership dbase in Access 2007, in which I need to send out individual membership fees annually to about 326 members. I have set up a form based on a query that runs the report with information of an individual member.
I am having difficulty in my code to loop through the reports and attach to the individual member's email. I can get it to email each member to Outlook, however it attaches all the reports not the individual members report.
Here is my code,
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("qryEmailInvoices", dbOpenDynaset)
rs.MoveFirst
Do
vMemberID = rs("MemberID")
DoCmd.SendObject acSendReport, "Email Invoices", "PDFFormat(*.pdf)", rs("Email Address"), "", "", "Northern Beaches Liquor Accord Membership", "Please find attached your invoice to renew your annual Membership", False
rs.MoveNext
Loop Until rs.EOF
rs.Close
db.Close
I have created a membership dbase in Access 2007, in which I need to send out individual membership fees annually to about 326 members. I have set up a form based on a query that runs the report with information of an individual member.
I am having difficulty in my code to loop through the reports and attach to the individual member's email. I can get it to email each member to Outlook, however it attaches all the reports not the individual members report.
Here is my code,
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("qryEmailInvoices", dbOpenDynaset)
rs.MoveFirst
Do
vMemberID = rs("MemberID")
DoCmd.SendObject acSendReport, "Email Invoices", "PDFFormat(*.pdf)", rs("Email Address"), "", "", "Northern Beaches Liquor Accord Membership", "Please find attached your invoice to renew your annual Membership", False
rs.MoveNext
Loop Until rs.EOF
rs.Close
db.Close