Try changing
Dim tb As Recordset
to
Dim tb As DAO.Recordset
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!)
"Jean-Paul" <jp.dewinter[ at ]telenet.be> wrote in message news:hzN1l.14324$_V3.8184[ at ]newsfe20.ams2...
[Quoted Text] > Hi, > > I converted my code from my previous 2003 version to the new access2007 > version. > > I get following error: > (I have to translate so could be a bit different) > > error 13 during executing: > Types are not matching > > The code: > > Dim db As Database > Dim tb As Recordset > Dim kl As String, afd As String, jr As String > Set db = CurrentDb() > Dim sql As String > sql = "SELECT leerlingen.* FROM leerlingen Where leerlingen.ID=" & > [Forms]![Gedrag]![leerling] & " ; " > Set tb = db.OpenRecordset(sql) > > I get the message at line: > Set tb = db.OpenRecordset(sql) > > In my 2003 version there is no problem... in the 2007 there is!! > > What to do? > Thanks
|