I'm using the code below and am getting a runtime error 3061 "Too few perameters. Expected 1." Error.
I am basing my code on this post.
I am pulling my email addresses from a query that is filtered from a combobox.
I debug and it highlights:
Set rsEmail = CurrentDb.OpenRecordset("EmailAdds") --> EmailAdds is my qry name.
Should I not be using the OpenRecordset? If not, what should I be using? I know I'm close...
I am basing my code on this post.
I am pulling my email addresses from a query that is filtered from a combobox.
Code:
Private Sub Command2_Click()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("EmailAdds")
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("EmailAddress").Value & ";"
rsEmail.MoveNext
Loop
strEmail = Left$(strEmail, Len(strEmail) - 1)
DoCmd.SendObject , , , , , strEmail, _
"Subject", _
"Good Afternoon" & _
vbCrLf & vbCrLf & "Your Message.", False
Set rsEmail = Nothing
MsgBox "Emails have been sent"
End Sub
I debug and it highlights:
Set rsEmail = CurrentDb.OpenRecordset("EmailAdds") --> EmailAdds is my qry name.
Should I not be using the OpenRecordset? If not, what should I be using? I know I'm close...