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?
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.
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.....
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.