run-time error: 13

G

Guest

Dim rs As Recordse
Dim sql As Strin

Private Sub Form_Activate(
Set rs = CurrentDb.OpenRecordset("SELECT * FROM Employee ORDER BY LastName"
End Su

I am trying to run this query when the form is opened, but the error I get is that there is a type mismatc
 
G

Gerald Stanley

You have probably got references to both DAO and ADO in
your database. When this is the case, it is best practise
to qualify any object that could be derived from either.
Try
Dim rs As DAO.Recordset

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
Dim rs As Recordset
Dim sql As String

Private Sub Form_Activate()
Set rs = CurrentDb.OpenRecordset("SELECT * FROM Employee ORDER BY LastName")
End Sub

I am trying to run this query when the form is opened, but
the error I get is that there is a type mismatch
 

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