I am getting Object required error with the following code at the SendMail line:
Code:
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strFound As String, strCriteria As String
Set db = CurrentDb
Set rst = Forms!frmMain_expandlg!SubForm1.Form!frmCampaignRecipients.Form.RecordsetClone
strCriteria = "[Email] IS NOT NULL"
rst.FindFirst strCriteria
strFound = rst.Bookmark
If rst.NoMatch Then
MsgBox "There are no records with email addresses"
rst.Bookmark = strFound
Else
SendMail rs![Email], rs![MailMergeEmailSubjectLine], rs![MailMergeID], rs![MailMergeEmailMessage], True, rs![MailMergeEmailFileAttachment], False
End If
rst.Close
[code]