View Full Version : Run-time error 13 Type Mismatch


Michael J Ross
08-24-2008, 02:33 AM
Hi

Been away from access for a while, I'm trying to run the following 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("Table1")
MyRS.MoveFirst

When i do i get the Run-time error 13 Type Mismatch error, when I click debug it takes me to

Set MyRS = MyDB.OpenRecordset("Table1")

Anyone got any ideas on what the mismatch is?

Thanks in advance for any input

twoplustwo
08-24-2008, 03:38 AM
try removing the "set" in the line where you set the recordset to tbl1

boblarson
08-24-2008, 05:45 AM
Change these lines:

Dim MyDB As Database
Dim MyRS As Recordset


to this:

Dim MyDB As DAO.Database
Dim MyRS As DAO.Recordset

Michael J Ross
08-24-2008, 06:59 AM
Thanks Bob, that did the trick. :)