Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Dim a Querydef or Database

Status
Not open for further replies.

CarlitosWay

Programmer
Oct 14, 2001
1
0
0
US
Hello everyone,

I am a fairly new programmer and have run into what seems to be a silly problem. I have attempted to “Dim” several variables with Database and QueryDef in Access 2000. For some reason when I run the code it gives me the following error message “User defined type not defined”. I believe that it is referring to the Database and QueryDef. When I run the code in Access 97, it does not give me this error message. Am I missing something? Did I forget to load a library? Here is an example of code that is not working.


Dim dbsNorthwind As Database
Dim qdfTemp As QueryDef
Dim qdfNew As QueryDef


Thanks
 
In your VBA Editor go to TOOLS>REFERENCES then check and make sure you have MS DAO Jet 3.XX or 4.XX checked.
 
Hi!
try this:

Dim dbsNorthwind As dao.Database
Dim qdfTemp As dao.QueryDef
Dim qdfNew As dao.QueryDef

this should do the trick!

hope it works!

Skep :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top