Db as Database

G

Guest

(Access 2000) I have copied a module from another working database and I am
just making some additions to it. In a sub in a module I have a line of code

Dim db As Database

On trying to compile an error occurrs 'User Defined Type Not Defined' on
this line. It is not listed as a choice, is this different in Access 2000 -
should it be something else?

Thanks in advance
Sue
 
R

Roger Carlson

You need to set a reference to DAO.

In any code window, go to Tools > References. Scroll down the list until
you find "Microsoft DAO 3.6 Object Model" and check the box. Close the
dialog box, and you will be all set.

Then, you will need to either get rid of the reference to ADO ("Microsoft
ActiveX Data Objects 2.6 Library") or add a DAO prefix to the object
datatype:

Dim db As DAO.Database

I recommend the latter.

For more information on References, look here:
http://members.iinet.net.au/~allenbrowne/ser-38.html

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
G

Guest

Thanks that worked a treat :)

Roger Carlson said:
You need to set a reference to DAO.

In any code window, go to Tools > References. Scroll down the list until
you find "Microsoft DAO 3.6 Object Model" and check the box. Close the
dialog box, and you will be all set.

Then, you will need to either get rid of the reference to ADO ("Microsoft
ActiveX Data Objects 2.6 Library") or add a DAO prefix to the object
datatype:

Dim db As DAO.Database

I recommend the latter.

For more information on References, look here:
http://members.iinet.net.au/~allenbrowne/ser-38.html

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top