Dim DAO.Database - problem

  • Thread starter Thread starter Rolf Rosenquist
  • Start date Start date
R

Rolf Rosenquist

I have got an Access program that works in my computer. Some part of its
code should be used in one of my own programs, so I copied and pasted those
lines of code. But I get the error that the type is not defined. The line
that doesn't work is: 'Dim db As DAO.Database'

When in the sample program, I can define a second dim and get the DAO as
well as Database from the combo, but these two aren't there when I write the
code in my own program. Where and how should I define those two forst?

/ Rolf
 
In the code window, choose References from the Tools menu.
Check the box beside:
Microsoft DAO 3.6 Library.

All versions of Access have this library selected by default except Access
2000 and 2002.

More info:
http://allenbrowne.com/ser-38.html
 
Rolf Rosenquist said:
I have got an Access program that works in my computer. Some part of
its code should be used in one of my own programs, so I copied and
pasted those lines of code. But I get the error that the type is not
defined. The line that doesn't work is: 'Dim db As DAO.Database'

When in the sample program, I can define a second dim and get the DAO
as well as Database from the combo, but these two aren't there when I
write the code in my own program. Where and how should I define those
two forst?

/ Rolf

Ensure you have a reference to Microsoft DAO 3.6 Object Library (in VBE
- Tools | References)
 
Thank you both Allen and Roy for your support! Now it works.
/ Rolf
 

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

Similar Threads


Back
Top