Send Object Help!

  • Thread starter Thread starter snappl3
  • Start date Start date
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!
 
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 -----
 
Back
Top