user defined type not defined
I tried the simple approach to send a bulk email to a list of people from a query and used:
---
Private Sub Command0_Click()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("qryEmailList")
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("email").Value
DoCmd.SendObject , , , strEmail, , , "Subject", "Message Text"
rsEmail.MoveNext
Loop
Set rsEmail = Nothing
End Sub
---
When I run it I get "user defined type not defined".
I am sure it is something simple but I'm not sure what?
Can anyone help?