G
Guest
It is probably obvious that I am a beginner, but I am trying to loop through
code to send a report as an attachment to an email to separate email
addresses. I am able to send the emails individually using SendObject in a
separate Sub (SeparateEmails), but I can't loop through the records to send
all emails with one command button without errors. My latest attempt with
the Do...Loop is as follows:
Dim db As Database
Dim Rst As Recordset
Set db = Currentdb()
Set Rst = db.OpenRecordset()
Do Until Rst.EOF
Call SeparateEmails
Rst.MoveNext
Loop
This results in a Compile Error: User-defined type not defined and
highlights Dim db As Database. Any suggestions?
Thanks.
code to send a report as an attachment to an email to separate email
addresses. I am able to send the emails individually using SendObject in a
separate Sub (SeparateEmails), but I can't loop through the records to send
all emails with one command button without errors. My latest attempt with
the Do...Loop is as follows:
Dim db As Database
Dim Rst As Recordset
Set db = Currentdb()
Set Rst = db.OpenRecordset()
Do Until Rst.EOF
Call SeparateEmails
Rst.MoveNext
Loop
This results in a Compile Error: User-defined type not defined and
highlights Dim db As Database. Any suggestions?
Thanks.