cannot declare databse

P

Prameela

I neet to declare and refer the current database in my VBA
code. When I declare
"Dim dbs As Database"
It doesn't work. Could someone tell me what i am doing
wrong? I am new to VBA programming.

Thanks in advance
Prameela
 
G

Gerald Stanley

Check the References. These are found in the Visual Basic
Editor under Tools->References. You will need the
Microsoft DAO 3.6 Object Library checked.

Hope This Helps
Gerald Stanley MCSD
 
A

Adrian Jansen

And you should explicitly refer to either DAO or ADO:

Dim dbs As DAO.Database

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
R

Ronald W. Roberts

Prameela said:
I neet to declare and refer the current database in my VBA
code. When I declare
"Dim dbs As Database"
It doesn't work. Could someone tell me what i am doing
wrong? I am new to VBA programming.

Thanks in advance
Prameela
You are missing a reference to the DAO Lib's.
Open a standard module, go to tools/references and check for "Missing
Reference".
Check or uncheck them, then clikc OK and close the form.

Ron
 

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