Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jul 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    57
    Thanks
    4
    Thanked 0 Times in 0 Posts

    user-defined type (XP)

    I was using the "AddNew Method Example" in the help to add a new record to a table. I get the "user-defined type not defined" error on the "Dim dbsInvestments as Database" line. I realize I have to define the database type but I don't know how to do that. Can you please help?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: user-defined type (XP)

    It may be a missing reference. In the Visual Basic Editor, select Tools | References... If you see MISSING references, clear their checkboxes and click OK. Test if the code will run now.

    If you still have problems: Database is an object in the ADO or DAO object model. You will need to set a reference to one of these. Determine whether you want to use ADO or DAO. If you don't know, pick ADO.
    For ADO, check Microsoft ActiveX Data Objects 2.n Library. Take the highest version you see.
    For DAO, check Microsoft DAO 3.6 Object Library.
    Don't check both, that will lead to confusion.
    Click OK, then test whether your code works.

    If all this doesn't solve the problem, post back.

  3. #3
    Star Lounger
    Join Date
    Jul 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    57
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: user-defined type (XP)

    Thanks Hans. The 'Microsoft DAO 3.6 Object Library' reference did the trick.

Posting Permissions

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