Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenRecordSet Produces Type MisMatch 1

Status
Not open for further replies.

NiallWestland1974

Programmer
Oct 22, 2003
7
GB
Hi All,
I'm trying to populate a recordset from a simple query, but I keep getting Type MisMatch (error 13) errors.. Anyone have any idea what the problem is, and how to solve it?

Dim dbs2 As Database
Set dbs2 = CurrentDb
Dim rst As Recordset
Dim qry As QueryDef

Set qdf = dbs2.QueryDefs("qryTest")
Set rst = qdf.OpenRecordset(dbOpenSnapshot)


If rst.BOF = True And rst.EOF = True Then
MsgBox "Nothing Found"
Else
rst.MoveLast
MsgBox "OrgID found: " & rst.Fields("OrgID")
End If

dbs2.Close

Thanks
 
Replace Dim qry as QueryDef with Dim qdf as QueryDef...
:)

Cheers,
MakeItSo

Andreas Galambos
EDP / Technical Support Specialist
Bowne Global Solutions Wuppertal, Germany
(andreas.galambos@bowneglobal.de)
HP:
 
D'oh! Rookie error :)

Mind you, still getting the "error 13 - Type MisMatch" error, with rst=Nothing in the debug window..
 
Replace it with Set rst=Nothing
cause rst is an object.. [pacman]

MakeItSo

Andreas Galambos
EDP / Technical Support Specialist
Bowne Global Solutions Wuppertal, Germany
(andreas.galambos@bowneglobal.de)
HP:
 
Hi

Do you have a reference to teh DAO library?

Do you also have a reference to the ADO library?

Recordset is present in both

Qualify it to avoid confusion

Dim rst As DAO.Recordset

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thats it! The

Dim rst As DAO.Recordset

Did the trick - thanks Ken - it never even occurred to me that there would be some confusion with the declaration of the recordset without declaring which library it used.

Many Thanks
Niall
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top