Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Victoria, Texas, USA
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problems importing a Switchboard (XP)

    When I import a switchboard into a new database file and try to run it I get a compile error: User defined type not defined for the following Dim statement:
    Dim dbs as database
    How do I get past this so I can use an imported Switchboard?
    Thanks

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

    Re: Problems importing a Switchboard (XP)

    The switchboard you are trying to import was probably made in Access 97. The code behind the Access 97 switchboard uses DAO to populate the menu options.

    In Access 2000 and 2002 (XP), there is no reference to the DAO object library by default. You can set it as follows:

    Activate the Visual Basic Editor (Alt+F11)
    Select Tools/References...
    Find Microsoft DAO 3.6 Object Library in the list and check the corresponding box.
    Click OK.

    Now, open the module behind the Switchboard form (you can doe this from Access, or directly in the Visual Basic Editor).
    Replace all occurrences of <font face="Georgia">Dim ... As Recordset</font face=georgia> in this module by <font face="Georgia">Dim ... As DAO.Recordset</font face=georgia>.
    This prevents confusion - ADO (the default data model in Access 2000/2002) also has a Recordset object.
    By explicitly stating that we are using a DAO recordset, Access knows how to handle it.

  3. #3
    Lounger
    Join Date
    Jan 2001
    Location
    Victoria, Texas, USA
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problems importing a Switchboard (XP)

    Thanks Hans
    I figured it might be something like that so I rebuilt the switchboard in xp and looked at the code behind the switchboard.
    Thanks
    Jim

Posting Permissions

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