Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Minneapolis, MN, Minnesota
    Posts
    162
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Compiling Error (Access 2002)

    I have a problem when I try to compile the VB module of a database I am working on. The error message, "User-defined type not defined" is displayed and "Dim db As DAO.Database" is highlighted from the Startup Module (as follows):

    Function HideStartupForm()
    On Error GoTo HideStartupForm_Err
    ' Uses the value of HideStartupForm check box to determine the setting for
    ' StartupForm property of database. (The setting is displayed in Display Form
    ' box in Startup dialog box).
    ' Used in OnClose property of Startup form.
    If Forms!Startup!HideStartupForm Then
    ' HideStartupForm check box is checked, so set StartupForm property to Main SwitchBoard.
    CurrentDb().Properties("StartupForm") = "Main SwitchBoard"
    Else
    ' HideStartupForm check box is cleared, so set StartupForm property to Startup.
    CurrentDb().Properties("StartupForm") = "Startup"
    End If

    Exit Function

    HideStartupForm_Err:
    Const conPropertyNotFound = 3270
    If Err = conPropertyNotFound Then
    Dim db As DAO.Database
    Dim prop As DAO.Property
    Set db = CurrentDb()
    Set prop = db.CreateProperty("StartupForm", dbText, "Startup")
    db.Properties.Append prop
    Resume Next
    End If
    End Function

    Can anyone tell me how to fix this?
    Easy Access

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

    Re: Compiling Error (Access 2002)

    Have you set a reference to the Microsoft DAO 3.6 Object Library (in the Visual Basic Editor, menu option Tools/References...)?

  3. #3
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Minneapolis, MN, Minnesota
    Posts
    162
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Compiling Error (Access 2002)

    Thanks Hans that solved my dilemna. <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Easy Access

Posting Permissions

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