Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: From 2003 to2007

Geek News

From 2003 to2007
Jean-Paul <jp.dewinter[ at ]telenet.be> 12/16/2008 12:55:53 PM
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
Re: From 2003 to2007
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> 12/16/2008 1:01:02 PM
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


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net