Run-time error '13': Type mismatch

G

Guest

I am getting the following error:

Run-time error ‘13’:
Type mismatch

My code that I am running is:

Private Sub btnSubmit_Click()
Dim dbMyDB As Database, qdMyQuery As QueryDef, rs As Recordset
Set dbMyDB = CurrentDb
Set qdMyQuery = dbMyDB.QueryDefs("qry2EAST")
Set rs = qdMyQuery.OpenRecordset()
End Sub

There are no parameters in the stored query as it is a simple select query.

Any help or insight into why I am getting this error would be appreciated.
 
D

Duane Hookom

You should be more explicit in your Dim's
Dim dbMyDB As DAO.Database, qdMyQuery As DAO.QueryDef, rs As
DAO.Recordset
This might or might not fix your problem. If it doesn't work, consider
coming back with the SQL view of qry2EAST.
 

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