Type Mismatch

J

JamesJ

I'm getting a type mismatch on the Set rst = line and can't
figure why.

Private Sub Form_Load()

Dim dbLocal As Database
Dim rst As Recordset

Set dbLocal = CurrentDb()
Set rst = dbLocal.OpenRecordset("tblDvdMovieType")

End Sub

Thanks,
James
 
G

Guest

One likely cause of this is that you have both ADO and DAO libraries
referenced in your project. Then when you declare rst it uses the first in
the list (ADO) recordset, and on the line that errors you are trying to set
it to DAO recordset (that is the result of OpenRecordset method)
 
J

JamesJ

I checked references and found Microsoft DAO 3.6 object Library
and moved it up the 3rd priority behind Visual Basic for Applications and
and Microsoft Access 11.0 Object Library. I see no references (as I can
figure) to ADO.
 
R

RoyVidar

JamesJ wrote in message said:
I checked references and found Microsoft DAO 3.6 object Library
and moved it up the 3rd priority behind Visual Basic for Applications and
and Microsoft Access 11.0 Object Library. I see no references (as I can
figure) to ADO.

ADO -> Microsoft ActiveX Data Objects 2.# Library

Try to disambiguate your declarations

Dim dbLocal As DAO.Database
Dim rst As DAO.Recordset
 

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