Dim Problems (1 Viewer)

kermit5

Registered User.
Local time
Today, 17:43
Joined
Nov 2, 2001
Messages
122
Hello.

I am completely flabergasted!

My desire is to create a Multiple-Selection List Box (Using Q121356 from the Microsoft Support page as my guide). I went through the trouble of creating the form I want using the Northwind Database as directed in the Microsoft example. I debugged it and it worked beautifully. I then moved the code to my application and I got the following compile error

User-defined type not defined

Dim DB As Database

It will not allow me to define a database object. Any idea why not or where I have set or neglected to set a property enabling me to do it?

[This message has been edited by kermit5 (edited 04-19-2002).]
 

doulostheou

Registered User.
Local time
Today, 11:43
Joined
Feb 8, 2002
Messages
314
Everytime I have gotten that error, I have had a missing reference. I usually get that when I'm at my other job that uses 2000. I am currently looking at 97, so the procedure may be a little different.

But Open up any module and go to tools/references. This should bring up all the references. You can compare what is checked in your database as opposed to the Northwind database. Check the missing reference, and then the code should work.
 

Jack Cowley

Registered User.
Local time
Today, 17:43
Joined
Aug 7, 2000
Messages
2,639
Change these two lines in your code to read like this:

Dim DB As DAO.Database
Dim RS As DAO.Recordset

Go to any code page and select Tools > Referenced and check Microsoft DAO 3.6 Object Library.

Access2000 uses ADO code and you are using DAO code, which is the code that Access97 uses.
 

Nero

Shop smart, shop S-Mart
Local time
Today, 17:43
Joined
Jan 8, 2002
Messages
217
Also check that the DAO library is of higher priority than the Active X Data Object Library.
You will get that error if it isn't.
 

Users who are viewing this thread

Top Bottom