Type mismatch

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?
 
J

Jim Allensworth

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top