Connecting Tech Pros Worldwide Help | Site Map

Error on defining DAO objects in the access VBA

alpha_male
Guest
 
Posts: n/a
#1: Nov 13 '05
Why I am not be able to define following objects:

Dim wrkDefault As Workspace
Dim dbsNew As database
Dim prpLoop As Property


I am getting in VBA "Compile error: User defined type not defined".
Still I can use DAO functions, but without making pointers for
objects. What could be wrong?

Ivars
Steve Jorgensen
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Error on defining DAO objects in the access VBA


It sounds like you simply don't have the reference set for DAO. In Access
2000 and above, the reference is not set up by default in new projects. YOu
have to add it under Tools -> References from the VB IDE. Also, you really
should get in the habit of fully qualifying the type names in case ADO is also
present, even though ADO does not have Database and Workspace classes.

Dim wrkDefault As DAO.Workspace
Dim dbsNew As DAO.Database
Dim prpLoop As DAO.Property


On 15 Dec 2004 07:55:23 -0800, alpha_male@inbox.lv (alpha_male) wrote:
[color=blue]
>Why I am not be able to define following objects:
>
>Dim wrkDefault As Workspace
> Dim dbsNew As database
> Dim prpLoop As Property
>
>
>I am getting in VBA "Compile error: User defined type not defined".
>Still I can use DAO functions, but without making pointers for
>objects. What could be wrong?
>
>Ivars[/color]

Closed Thread