Simple sub

  • Thread starter Thread starter Yoann Duriaud
  • Start date Start date
Y

Yoann Duriaud

Hello,
I wrote a couple of lines of code for a first project where everything went
fine.
Now I'm trying to do the same thing again and it doesn't work...
(I'm using Access XP)

Here is the sub I want to start with:

Sub f()
Dim r As Recordset
Set r = CurrentDb.OpenRecordset("ENUM_LIST")
End Sub

I get a "Type Mismatch" error.
If I define r as a Variant, then I don't get the error message but r does
not have all the properties of a recordset.


Also, when I try:
Dim a as QueryDef

I get a message telling me that the type does not exist.

Does anyone know what is wrong?

Yoann
 
You most likely have a problem with the references in your project - New
databases in Access 2000/2002 by default do not have a reference to the DAO
Library, you have to set it yourself and either move it ahead of the ADO
library or remove the ADO library entirely. Check this article for more
details and info on how to fix the problem:

http://www.mvps.org/access/bugs/bugs0031.htm
 
Thanks, that solved the problem!

Yoann


Sandra Daigle said:
You most likely have a problem with the references in your project - New
databases in Access 2000/2002 by default do not have a reference to the DAO
Library, you have to set it yourself and either move it ahead of the ADO
library or remove the ADO library entirely. Check this article for more
details and info on how to fix the problem:

http://www.mvps.org/access/bugs/bugs0031.htm

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

Yoann said:
Hello,
I wrote a couple of lines of code for a first project where everything
went fine.
Now I'm trying to do the same thing again and it doesn't work...
(I'm using Access XP)

Here is the sub I want to start with:

Sub f()
Dim r As Recordset
Set r = CurrentDb.OpenRecordset("ENUM_LIST")
End Sub

I get a "Type Mismatch" error.
If I define r as a Variant, then I don't get the error message but r does
not have all the properties of a recordset.


Also, when I try:
Dim a as QueryDef

I get a message telling me that the type does not exist.

Does anyone know what is wrong?

Yoann
 
Back
Top