Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2001
    Posts
    175

    Question Unanswered: Declaring Variables in Access 2000

    I am trying to declare a variable as type 'Database' eg
    dim dbs as Database

    set dbs = currentdb

    but when I compile I get the following compile error:
    'user defined type not defined'

    Please help!!

  2. #2
    Join Date
    Apr 2002
    Posts
    1
    Try this,

    dim objdb as database

    set objdb = currentdb()

  3. #3
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    32
    Well, it doesn't work because Access 2000 uses ADO by default. The Database object is part of the DAO model.

    So you have to enable DAO support. From the Visual Basic windows select menu Tools/References and enable 'Microsoft DAO 3.6 Object Library'. That's it.

    peter

  4. #4
    Join Date
    Sep 2001
    Posts
    175
    Thanks Guys,

    The 'Microsoft DAO 3.6 Object Library' was not enabled.

    It's working now!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •