If you dimension an object as a Recordset and then set that object to databaseobject.OpenRecordset(source), you may receive the following error message:
Run time error '13': Type mismatch
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.
Dim adoRS As ADODB.Recordset
Dim daoRS As DAO.Recordset
Dim dbs AS Database
Dim rs AS Recordset ' When you press the spacebar after "AS," the
' list box includes multiple Recordset entries.
' Pick any Recordset item, or type "Recordset."
Private Sub Form_Load()
Set dbs=OpenDatabase(dbname)
Set rs=dbs.OpenRecordset(source) ' The error occurs when this line
' of code executes.
End Sub
Keywords: kbbillprodsweep, kbdsupport, kbprb, kb