User defined type not defined

G

Guest

Is there something wrong with this declaration, I am getting the below error
message for dim db as database
Compile error:
User defined type not defined
 
B

Brendan Reynolds

You need to add a reference (Tools, References in the VBA editor) to
Microsoft DAO 3.6 Object Library.
 
G

Guest

Check your reference, if you have reference to Microsoft DAO 3.6
(to do that, open code, anywhere, select tools > reference > and add it from
the list)

And change the code to
Dim db As Dao.Database
Dim rec As Dao.Recordset
 

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