Type mismatch

  • Thread starter Thread starter CliffordZivi
  • Start date Start date
C

CliffordZivi

I am working through Microsoft Knowlegebase artical
318881. Item number 5 says to copy some code for a module
which I have done. But I am getting a "type mismatch"
error. The artical says it is for ACC97 but I am using
2002. But I think this code should still work. Please
see below secion of code:

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("tblMailingList")

They type mismatch occurs at the "Set MyRS" line. It all
looks good to me. Any ideas?
 
I am working through Microsoft Knowlegebase artical
318881. Item number 5 says to copy some code for a module
which I have done. But I am getting a "type mismatch"
error. The artical says it is for ACC97 but I am using
2002. But I think this code should still work. Please
see below secion of code:

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("tblMailingList")

They type mismatch occurs at the "Set MyRS" line. It all
looks good to me. Any ideas?

First check your References - make sure you have one set for Microsoft
DAO object library. If not locate it and check it.

Then disambiguate your code by explicitly declaring the type of
recordset you are using.

Dim MyRS As DAO.Recordset

- Jim
 
Back
Top