run-time error: 13

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top