G
Guest
I am trying to create a recordset using the following portion of code. I get
a type mismatch error on the "Set MyRS=" line. The code works fine in a test
database I created but I get the error in the database that I need. Any help
would be much appreciated.
Option Compare Database
Option Explicit
Sub SendMessages(Optional AttachmentPath)
Dim MyDB As Database
Dim MyRS As Recordset
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim TheAddress As String
Set MyDB = CurrentDb
Set MyRS = MyDB.OpenRecordset("tblCitations")
MyRS.MoveFirst
a type mismatch error on the "Set MyRS=" line. The code works fine in a test
database I created but I get the error in the database that I need. Any help
would be much appreciated.
Option Compare Database
Option Explicit
Sub SendMessages(Optional AttachmentPath)
Dim MyDB As Database
Dim MyRS As Recordset
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim TheAddress As String
Set MyDB = CurrentDb
Set MyRS = MyDB.OpenRecordset("tblCitations")
MyRS.MoveFirst