Confirmation Email

G

Guest

Hi all,
I want to be able to send out shipment confirmation emails at the end of the
day, based on a query that populates with the records that meet some
specified criteria. Any record that shows in this query result set will need
to have an email sent to the customer on record. I am having the hardest
time locating some code snipets that I could experiment with. How would I be
able to have it go through each record and send an email? Any help,
guidance, or code would be greatly appreciated. Thanks!
-gary
 
G

Guest

Try something like

Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("YourQueryName")
If rst.RecordCount > 0 Then 'ensure there is data
rst.MoveFirst 'goto the 1st recordset
Do Until rst.EOF 'End of file
'Send your e-mail Here
'
'
rst.MoveNext
Loop
Else
MsgBox "No Query Results To Process!", vbInformation
End If
 

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