Confirmation Email

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