Utilize a table to tell where to email specified reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to be able to use a table to put email addresses in and specify
what reports I send to certain people. I would like to be able to build a
query and macros that would generate the reports and the selected reports to
the specified people in the table.
Email address Report 1 Report 2 Report 3
Report 4
(e-mail address removed) (yes) (no) (yes)
(yes)
(e-mail address removed) (no) (yes) (yes)
(yes)
(e-mail address removed) (yes) (yes) (yes)
(yes)
(e-mail address removed) (no) (no) (no)
(Yes)

I would like to be able to send John Doe report 1, 3 and 4
Jane Report 2,3,4
Tom report 1,2,3,4
Joe report 4

This to me makes more sense than building a macro for each report. It would
be easier to change the table than to go in and change 4 macros.
 
Adding to Mr Stone's link, below are a couple of links to code for sending
email from Access.

http://www.mvps.org/access/general/gen0009.htm
http://www.granite.ab.ca/access/email.htm

If you already have written a macro which sends email and you like how it
works or wish to keep doing it using macros for the sending then what you
can do is use VBA to "build" and/or edit a macro on the fly, and then
execute that macro (execute it automatically from within VBA).
For example you may have an existing macro that emails a certain report(s)
to (e-mail address removed) and (e-mail address removed) . What you could do is edit that macro from
within VBA to adjust it to email to everyone in your table who needs that
report (and likewise you can also change which report it is that they get
emailed), and then execute that macro from within VBA. In your case your
VBA would loop around 4 times for each of the 4 reports, and within each
loop changing
1. the report that is going to be sent
2. which recipients will get it

This would be really useful particularly if your macro executes an existing
piece of emailing code that you dont know or care about and dont want to be
editing or moving or calling directly.

If you want to do this then reply and the access community will assist.

Regards
AC
 
Back
Top