jimday1982
Registered User.
- Local time
- Yesterday, 20:45
- Joined
- May 13, 2004
- Messages
- 81
The code below is sending an e-mail to each e-mail address in my recordset, but it's sending one PER RECORD instead of PER E-MAIL ADDRESS...I can't find anything wrong - can you?
Thanks for your help.
Code:
If Not rst1.EOF Then
Do While Not rst1.EOF
emailto = rst1("[email]")
strbody1 = strbody1 & rst1("[ponumber]") & "," & rst1("[odr_date]") & "," & rst1("[supplierid]") & "," & rst1("[name]") & "," & rst1("[fax]") & "," & rst1("[contact]") & vbCrLf
If emailto = strPrevEmail Then
If Len(emailto) <> 0 And Left(emailto, 1) <> " " Then
DoCmd.SendObject acSendNoObject, , , emailto, , , "Open POs from Dynadirect", "Open PO(s)" & vbCrLf & vbCrLf & strbody1, True
Else
End If
Else
strbody1 = ""
End If
strPrevEmail = rst1("Email")
rst1.MoveNext
Loop
End If
Thanks for your help.