Implementing filter by VBA

reglarh

Registered User.
Local time
Today, 05:54
Joined
Feb 10, 2014
Messages
118
I have a report that I wish to email a different page to individual recipients, whose email address is contained with the report.

I firstly placed an 'email' button on the report, and using a DoCmd VBA function managed to email the whole report to each person. I then used the filter menu option to filter on the recipient's email address by right clicking the field and applying a filter, followed by clicking the 'email' button but this leaves a two stage process. Can I combine both functions in VBA i.e. click the email address and then the 'email' button which would send just that page of the report to the recipient, or even better send the email simply by clicking the email address? It's the applying the filter that I can't get my head around. All threads I have read show how to filter on loading the report, or get the user to enter a value from a combo box to initiate the filter action.

Ideally I would like to open the report and with a single click email the relevant page to each recipient. I have seen this discussed before, but the threads never seem to reach a conclusion!

Thanks
 
I would use a loop and filter the report when it opens.
So it would be:

  • Get the first E-mail you want to send the report to:
  • Open the report with the filter.
  • Attached it to the E-mail.
  • Send the E-mail
  • Close the report
  • Get next E-mail
 

Users who are viewing this thread

Back
Top Bottom