Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006
    Location
    MI
    Posts
    2

    Red face Unanswered: Object or class does not support the set of events...

    After running "Compact and Repair Database", I am unable to open any of my forms that contain events for the Form object (such as On Open, On Load...) without receiving the error "The expression [event name such as On Open] you entered as the event property setting produced the following error:Object or class does not support the set of events." Creating new forms with events causes the same error; even if the subs are empty. Moving the database to other environments causes no different results.

    Thanks
    ___________________________________
    Access 2003 SP2 on Windows XP Pro SP2

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Check your references ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Jun 2006
    Location
    MI
    Posts
    2

    Question

    Although this problem started randomly after "Compress and Repair", I've noticed that if I comment out the red portion of this macro (all of which hides the Access Window), everything works properly. The weird part is that "Form" events that had nothing to do with this code segment still caused the above error; but stopped when the following red portion was commented out.

    Code:
    Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
    Dim dwReturn As Long
    
    Const SW_HIDE = 0
    Const SW_SHOWNORMAL = 1
    Const SW_SHOWMINIMIZED = 2
    Const SW_SHOWMAXIMIZED = 3
    
    Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
         ByVal nCmdShow As Long) As Long
         
    Public Function fAccessWindow(Optional Procedure As String, Optional SwitchStatus As Boolean, Optional StatusCheck As Boolean) As Boolean
    If Procedure = "Hide" Then
        dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
    End If
    If Procedure = "Show" Then
        dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
    End If
    If Procedure = "Minimize" Then
        dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED)
    End If
    If SwitchStatus = True Then
        If IsWindowVisible(hWndAccessApp) = 1 Then
            dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
        Else
            dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
        End If
    End If
    If StatusCheck = True Then
        If IsWindowVisible(hWndAccessApp) = 0 Then
            fAccessWindow = False
        End If
        If IsWindowVisible(hWndAccessApp) = 1 Then
            fAccessWindow = True
        End If
    End If
    End Function

Posting Permissions

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