Dim DAO.Database - problem

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
 
R

RoyVidar

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)
 

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