peterbowles
Registered User.
- Local time
- Today, 02:15
- Joined
- Oct 11, 2002
- Messages
- 163
I am trying to send an email to a list of people The code sort of works I get this error
User-defined type not defined
Dim rsEmail As DAO.Recordset - this is the highlighted line
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("EmailList")
strEmail = rsEmail.fields("Email").Value
rsEmail.MoveNext
Do While Not rsEmail.EOF
strEmail = strEmail & " ; " & rsEmail.fields("Email").Value
rsEmail.MoveNext
Loop
DoCmd.SendObject , , , strEmail, , , "Test 7", Text2, False
Set rsEmail = Nothing
MsgBox "Emails have been sent"
End Sub
User-defined type not defined
Dim rsEmail As DAO.Recordset - this is the highlighted line
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("EmailList")
strEmail = rsEmail.fields("Email").Value
rsEmail.MoveNext
Do While Not rsEmail.EOF
strEmail = strEmail & " ; " & rsEmail.fields("Email").Value
rsEmail.MoveNext
Loop
DoCmd.SendObject , , , strEmail, , , "Test 7", Text2, False
Set rsEmail = Nothing
MsgBox "Emails have been sent"
End Sub