B
Brian
Hello All,
I am trying to email a series of clients using the SendTo
routine. When I run this code I get a Data Type Mismatch
in the Set RS=dbs... line.
I'm stumped.
Dim dbs As Database, RS As Recordset
Dim lngRSCount As Long
Set dbs = CurrentDb
Set RS = dbs.OpenRecordset("emails", dbOpenDynaset)
lngRSCount = RS.RecordCount
If lngRSCount = 0 Then
MsgBox "No email messages to send.", vbInformation
Else
RS.MoveLast
RS.MoveFirst
Do Until RS.EOF
' Send the email
DoCmd.SendObject acSendReport, "emails",
acFormatTXT, email, , , "CAPTEL Survey", "Attached is the
CAPTEL Survey", 0
RS.MoveNext
Loop
End If
RS.Close
MyDB.Close
Set RS = Nothing
Set MyDB = Nothing
Close
Exit Sub
Thanks in advance.
Brian
I am trying to email a series of clients using the SendTo
routine. When I run this code I get a Data Type Mismatch
in the Set RS=dbs... line.
I'm stumped.
Dim dbs As Database, RS As Recordset
Dim lngRSCount As Long
Set dbs = CurrentDb
Set RS = dbs.OpenRecordset("emails", dbOpenDynaset)
lngRSCount = RS.RecordCount
If lngRSCount = 0 Then
MsgBox "No email messages to send.", vbInformation
Else
RS.MoveLast
RS.MoveFirst
Do Until RS.EOF
' Send the email
DoCmd.SendObject acSendReport, "emails",
acFormatTXT, email, , , "CAPTEL Survey", "Attached is the
CAPTEL Survey", 0
RS.MoveNext
Loop
End If
RS.Close
MyDB.Close
Set RS = Nothing
Set MyDB = Nothing
Close
Exit Sub
Thanks in advance.
Brian