CurrentDB problem..

A

Alex

Hi anyone,
Here what I have for you:

1 Dim db As Database
2 Dim rs As Recordset
3 Dim strSQL As String

4 strSQL = "SELECT * FROM tbl_Orders"
5 Set db = CurrentDb
6 Set rs = db.OpenRecordset(strSQL)

At line 6 it says: "Type Mismatch.." code 13.
All compiles fine, I have DAO 3.6 checked.

What is the problem?

P.S. it seems to me it does not even sees the CurrenDB..

Thanks for you help, Wizards.
 
D

dan artuso

Hi,
If you also have ADO as a reference, you have be clear on which library
you want the recordset to come from.

Dim rs As DAO.Recordset

should fix it. (or remove the ADO reference)
 
G

Guest

Thanks for your help, Dan.
Though I didn't have ADO as reference, I guess it took it
by default. Thanks again.
 

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