Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emailing Report Pages

Status
Not open for further replies.

leadpro

Technical User
Jan 7, 2005
34
0
0
US
I've created report/invoices to print out one per page, however it would be nice to email of these to each respective [ClientID] without creating a report/invoice for each client and then a macro for each client...any ideas?
 
You could write a vba procedure that

1. Creates a recordset of all the clients and their emails.
2. Iterates through the recordset and does the DoCmd.SendMail function to send an invoice for each customer.

You will probably have to include a query def in the iteration to dynamically change the recordsource of the invoice to show only the client for that iteration cycle.

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 

for a loop structure of some sort to build lots of individual reports and send them...

set rst=currentdb.openrecordset("EmailList") 'email list is a table of contacts emails
if rst.recordcount>0 then
do until rst.eof=true
docmd.openreport "reportname",,"recipient=" & rst!recipient 'where clause set to recipient name
rst.movenext
loop
end if

This would just print it, but you could include code to email as well.....

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top