Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dim As Database produces error in Access 2k

Status
Not open for further replies.

RobJDB

Programmer
May 13, 2002
44
GB
Hi,
When I use

Dim myDB As Database

I get the error message 'User-defined type not defined'.
I also get it if I use

Dim myDB As DAO.Database

I'm using Access 2000.
Does anyone know what I should do? I'm aware that Access 2k uses ADO by default, not DAO (although I don't really know what this means). Can you point me to a tutorial website that will guide me through the basics of programming in Access 2000, or recommend a good book for beginners?

I've seen another post about this that said to go to Tools > References and check the DAO library, but References is greyed out.

I'm stuck!

Rob
 
You should still be able to use DAO with Access 2000. Not sure why references should be greyed out. Maybe someone has come across this before. Have fun! :eek:)

Alex Middleton
 
In Access open any module in design mode. Click Tools > References. Look for an entry "Microsoft DAO 3.6 Object Library" and check the box. Your code should work now. Database is a DOA object type not supported by default in Access2K.
 
Thanks, References stopped being greyed out (don't know why it was!) so I've got that sorted now. What about the CreateField method? Does Access 2000 recognise that? I get errors each time I try to use it.
 
The references is greyed out when you are debuging, but comes back when you are just editing code. Just figured this on out myself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top