Run-time error 13 Type Mismatch

Michael J Ross

Registered User.
Local time
Today, 13:16
Joined
Mar 2, 2006
Messages
245
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
 
try removing the "set" in the line where you set the recordset to tbl1
 
Change these lines:
Code:
Dim MyDB As Database
Dim MyRS As Recordset

to this:
Code:
Dim MyDB As [b][color=red]DAO.[/color][/b]Database
Dim MyRS As [b][color=red]DAO.[/color][/b]Recordset
 

Users who are viewing this thread

Back
Top Bottom