Stepping through a table row by row, emailing a report

lundi 23 mars 2015

I have a table, each row contains information that I want email out as a pdf.



i've created a report, and at the moment I've created a button embedded with the onscreen report which emails the report I'm actually looking at onscreen (as an attachment), all the button is doing is event-on click running this VBA code...




Code:



DoCmd.SendObject acSendReport, "rptSalesReceiptMain_UK", acFormatPDF, DLookup("[Email]", "[Sales]", "[PrintInvoice]=True"), , , "VAT Receipt for your order", "As requested, please find your VAT sales receipt attached"


...it all works, but it's very manual....because I have to open up each report manually, & then click the button manually to create the email



Since I have the main 'chunky' parts done (i.e. creating the report & the code that emails it when I click a button), I'm now turning my attention to automating.



I'd like to add a new true/false column to my table "Receipt Emailed" (or similar) & have a bit of VBA hunt down the column, then it comes across a false condition, it runs the report & emails it.



therefore rather than me opening the report & clicking on the button (which runs vba code), how do I get this done automatically?

Stepping through a table row by row, emailing a report

0 commentaires:

Enregistrer un commentaire

Labels