I attempted to get this done myself and I do not really understand looping and checking record sets to ensure there is a value. SO, I am asking the guru's to take a look at this project and see I am even worthy of being helped.
I tried using a loop sendobject email out but it is not working. It sends one record and thats it. I am also wanting a CC added by looking up in quesrry as well and i can not get that to work so i took it out of the code. Please take a look at my database and HELP!!! My code reads as follows which i attempted to copy from a differnt Thread.
Public Function SendallEMail()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Dim strRef As String
Dim strMessage As String
Dim strEmail2 As String
Set rsEmail = CurrentDb.OpenRecordset("qry_Time_Followup")
strRef = rsEmail.fields("Subject").Value
strEmail = rsEmail.fields("Email_Address").Value
strMessage = rsEmail.fields("Journal_Notes").Value
rsEmail.MoveNext
Do While Not rsEmail.EOF
strRef = rsEmail.fields("Subject").Value
strEmail = rsEmail.fields("Email_Address").Value
strMessage = rsEmail.fields("Journal_Notes").Value
rsEmail.MoveNext
Loop
rsEmail.MoveFirst
rsEmail.MoveNext
Do While Not rsEmail.EOF
strRef = rsEmail.fields("Subject").Value
strEmail = rsEmail.fields("Email_Address").Value
strMessage = rsEmail.fields("Journal_Notes").Value
rsEmail.MoveNext
Loop
DoCmd.SendObject , , , strEmail, , , strRef, strMessage, False, False
Set rsEmail = Nothing
MsgBox "The emails are in your emails Outbox and will be sent automatically during the next send recieve"
End Function
I tried using a loop sendobject email out but it is not working. It sends one record and thats it. I am also wanting a CC added by looking up in quesrry as well and i can not get that to work so i took it out of the code. Please take a look at my database and HELP!!! My code reads as follows which i attempted to copy from a differnt Thread.
Public Function SendallEMail()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Dim strRef As String
Dim strMessage As String
Dim strEmail2 As String
Set rsEmail = CurrentDb.OpenRecordset("qry_Time_Followup")
strRef = rsEmail.fields("Subject").Value
strEmail = rsEmail.fields("Email_Address").Value
strMessage = rsEmail.fields("Journal_Notes").Value
rsEmail.MoveNext
Do While Not rsEmail.EOF
strRef = rsEmail.fields("Subject").Value
strEmail = rsEmail.fields("Email_Address").Value
strMessage = rsEmail.fields("Journal_Notes").Value
rsEmail.MoveNext
Loop
rsEmail.MoveFirst
rsEmail.MoveNext
Do While Not rsEmail.EOF
strRef = rsEmail.fields("Subject").Value
strEmail = rsEmail.fields("Email_Address").Value
strMessage = rsEmail.fields("Journal_Notes").Value
rsEmail.MoveNext
Loop
DoCmd.SendObject , , , strEmail, , , strRef, strMessage, False, False
Set rsEmail = Nothing
MsgBox "The emails are in your emails Outbox and will be sent automatically during the next send recieve"
End Function
Attachments
Last edited: