Need help with emailing using send object vba please

R

Ron Ehrlich

I have a table where the fields are part number, on hand quantity, reorder
quantity, and email address. The email address is the person who should get
the email when the on hand quantity is equal to or less than the reorder
quantity. I would like to run a report of all part numbers that have on hand
<= to reorder sorted by email address and then send ONE email to the person
showing just the part numbers that that person should be reordering, but I
want to make one run for all the email addresses in that table. When I try to
do this in the on print event, it says that I cannot send object when the
object I am trying to email is the report. Thanks in advance.
 
A

aaron.kempf

If SendObject doesn't work well for you-- I'd move to XP_SENDMAIL
This procedure for sending email is much much much more powerful and
easier to troubleshoot / administer.
 
T

Tony Toews [MVP]

Ron Ehrlich said:
I have a table where the fields are part number, on hand quantity, reorder
quantity, and email address. The email address is the person who should get
the email when the on hand quantity is equal to or less than the reorder
quantity. I would like to run a report of all part numbers that have on hand
<= to reorder sorted by email address and then send ONE email to the person
showing just the part numbers that that person should be reordering, but I
want to make one run for all the email addresses in that table. When I try to
do this in the on print event, it says that I cannot send object when the
object I am trying to email is the report. Thanks in advance.

You need to setup some VBA to do this which you can't do from inside
the report.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

See the Sample Code illustrating looping through a DAO recordset page
at the Access Email FAQ at
http://www.granite.ab.ca/access/email/recordsetloop.htm

Please ignore Aaron Kempf's posting as he is monomaniacal on the
subject of SQL Server.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top