Hi
I'm using Access XP, and having a problem with the OpenRecordSet method. If I try the code below, I keep getting a type mismatch error at the 'Set MyRs' line.
Function testit()
Dim MyDb As Database
Dim MyRs As Recordset
Set MyDb = CurrentDb()
Set MyRs = MyDb.OpenRecordset("MyQuery")
I've set the reference to the MS DAO 3.6 library, so can't understand why I'm getting this error. I've put the identical code into one of my other databases and it works fine.
I'm totally confused now!
Any help would be much appreciated.
Thanks
LeonH
End Function
I'm using Access XP, and having a problem with the OpenRecordSet method. If I try the code below, I keep getting a type mismatch error at the 'Set MyRs' line.
Function testit()
Dim MyDb As Database
Dim MyRs As Recordset
Set MyDb = CurrentDb()
Set MyRs = MyDb.OpenRecordset("MyQuery")
I've set the reference to the MS DAO 3.6 library, so can't understand why I'm getting this error. I've put the identical code into one of my other databases and it works fine.
I'm totally confused now!
Any help would be much appreciated.
Thanks
LeonH
End Function