Send Object Help!

S

snappl3

I'm trying to get a a send object to e-mail clients based on a query I run.
(The query bring up the clients and I need the code to send an e-mail to the
clients who come up as a result o the query). Any help would be much
appreciated. Thanks!
 
D

Dirk Goldgar

snappl3 said:
I'm trying to get a a send object to e-mail clients based on a query I
run.
(The query bring up the clients and I need the code to send an e-mail to
the
clients who come up as a result o the query). Any help would be much
appreciated. Thanks!


Here's the basic approach:

'----- start of example code -----
Dim rs As DAO.Recordset

Set rs = CurrentDb.OpenRecordset("qryClientEmails")
With rs
Do Until .EOF
If Len(rs!Email & vbNullString) > 0 Then
DoCmd.SendObject _
To:=rs!Email, _
Subject:="Your Message Subject", _
MessageText:="Your message text goes here."
End If
.MoveNext
Loop
.Close
End With

Set rs = Nothing
'----- end of example code -----
 

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