How can I automate emailing reports using an address in the report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table that is gathering data from a webpage. I have a report set up
based on a query from the data in this table. I have 25 users who could
receive the report, based on whether it is their customer or not on the
report. How do I automatically email a snapshot attachment of the report to
the users? I have tried to use the SendObject macro, but can not find a way
to have the macro read the email address it should send to from the report.
 
I don't know all the specifics of your situation, however, I can make some
general suggestions. One alternative would be to query for the email
addresses in the report in a query similar to the one behind your report.
You could then use code behind a button on a form for example, to query for
the email addresses and then perform the SendObject function for each
address.

Below is a simplified example. If you want to provide additional details, I
can try to be more specific.

Function EmailReports()
Dim rs As DAO.Recordset

Set rs = CurrentDb.OpenRecordset("SELECT Email FROM MySalesTable;")

Do Until rs.EOF
DoCmd.SendObject acSendReport, "MySalesReport", acFormatSNP,
rs("Email"), , ,
"Quarterly Sales Report", "Some Text", False
rs.MoveNext
Loop

Set rs = Nothing

End Function


--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


I have a table that is gathering data from a webpage. I have a report set up
based on a query from the data in this table. I have 25 users who could
receive the report, based on whether it is their customer or not on the
report. How do I automatically email a snapshot attachment of the report to
the users? I have tried to use the SendObject macro, but can not find a way
to have the macro read the email address it should send to from the report.
 
Back
Top