generate email to a dynamic list of addresses

G

Guest

How do I automate sending an email to the email addresses in records that
meet the criteria of a query?

I want to run a query to identify people who are overdue on certifications.
The query will return a list of people (records) where the dates in those
records are older than the date I will enter in the query. I then want to
print a report to review, and then run a macro to send an email to the
addresses in those records to tell them they are overdue and to please take
care of it.

I know how to use SendObject in a macro, but I don't know how to point it to
a list of addresses created by a query. Or maybe there is a better way to
accomplish this.
 
S

Steve Schapel

Brownlmap,

The SendObject action in a macro is quite good for email to a single
email address. To send to multiple addresses, it is possible but rather
awkward, and requires the use of a user-defined function to concatenate
the email addresses together. In this case, using a VBA procedure is
easier. You would create a Recordset based on your query, loop through
it to build a string for the To: argument, and then use DoCmd.SendObject
method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top