Hi, I am able to mail a report in access to multiple receptions via Marcos. I want to mail specific parts of the report to specific people, every header with data to a person, and so on.
Can anybody assist with the code ordirections.
Thank you
Hi, I am able to mail a report in access to multiple receptions via Marcos. I want to mail specific parts of the report to specific people, every header with data to a person, and so on.
Can anybody assist with the code ordirections.
Thank you
create a form, frmRpts.
on the form is a list box of all userID, emails. lstEmails (Username is col1, email addr is col2.)
put a button on the form, btnSend, to cycle thru the list sending the report.
select a user in the list box.
Build a query to look at this item in the list and show ONLY their data.
ie: select * from data where [userid] = forms!frmRpts!lstEmails
this query is what the report uses. NOTE: in vb code, col 1 starts with 0, etc.
user clicks button to send all reports:
Code:sub btnSend_click() 'scan the list box For i = 0 To lstEmails.ListCount - 1 vTo = lstEmails.Column(1) DoCmd.SendObject acSendReport, vRpt, acFormatPDF, vTO, , , vSubj, vBody Next End Sub
create a form, frmRpts.
on the form is a list box of all userID, emails. lstEmails (Username is col1, email addr is col2.)
put a button on the form, btnSend, to cycle thru the list sending the report.
select a user in the list box.
Build a query to look at this item in the list and show ONLY their data.
ie: select * from data where [userid] = forms!frmRpts!lstEmails
this query is what the report uses. NOTE: in vb code, col 1 starts with 0, etc.
user clicks button to send all reports:
Code:sub btnSend_click() 'scan the list box For i = 0 To lstEmails.ListCount - 1 vTo = lstEmails.Column(1) DoCmd.SendObject acSendReport, vRpt, acFormatPDF, vTO, , , vSubj, vBody Next End Sub
Thanks will give it a try