problem opening recordset... Type Mismatch error

pungentSapling

NeedHotSauce?
Local time
Yesterday, 19:18
Joined
Apr 4, 2002
Messages
115
when I run this code I am getting a type mismatch error showing up at "Set rst ........." line of code.
I don't know why.. Please help.
Thanks


Dim rst As Recordset
Dim dbs As Database
Dim var As String
Dim sql As String


Set dbs = CurrentDb
var = Forms![sFrmTimeRec]!cboJobNumber.Value
MsgBox var
sql = "SELECT * FROM tblProject Where ProjectNumber = '" & var & "'"
Set rst = dbs.OpenRecordset(sql)
 
RESOLVED

I fingered it out.. .thanks to using a better search string on this forum....
I removed the reference to active x data objects 2.x and it cured the problem.

RESOLVED

thanks all.
 
As far as I'm aware, you don't have to remove the reference, just make sure the DAO 3.6 reference is before it in the list.
 
Or be more specific with you referencing ie

Dim dbs as DAO.Database, rs as DAO.Recordset
 

Users who are viewing this thread

Back
Top Bottom