Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Required

Status
Not open for further replies.

primagic

IS-IT--Management
Jul 24, 2008
476
GB
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]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top