Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Cedar Falls, Iowa, USA
    Thanked 0 Times in 0 Posts

    compile error (A2002)

    I'm getting the following compile error:
    User-defined type not defined

    The problem code is:
    Dim dbMdb As Database, prp As Property

    Background: Found a great calculator control in A2000. It works great in A2000 and, when I converted to A2002 still worked. It was only after I Imported the autokey, module and the form into another A2002 database that I had a problem. Any ideas?


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: compile error (A2002)

    Activate the Visual Basic Editor
    Select Tools | References...
    Locate and tick "Microsoft DAO 3.6 Object Library"
    Click OK.
    This reference was present in the original database, and if you convert, the reference will come with it. But by default, this reference is not set in an Access 2000 or higher database, and importing a form will not import references.

    I recommend that you prefix the declarations with DAO. :
    Dim dbMdb As DAO.Database, prp As DAO.Property
    This makes explicit to which libarary these objects belong, and it can prevent confusion. For example, Property is both a DAO and an ADO object, and the same holds for Recordset.

Posting Permissions

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