Results 1 to 11 of 11
  1. #1
    Glenn_Suggs is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    72

    Question Object or class not supporting set of events

    This is the error I'm getting. A little obscure, I know, but this is happening in an executable Access application (2010 accde) when I click the close button on a form. The code behind the form is checking a lot of stuff (data validation, etc.), but "Object or class does not support the set of events" is the error. Then the application continues as if nothing had happened. Does anyone have an idea about what might be causing this? The app was converted not long ago from XP ACC2003 to Win 7 ACC2007-2010.



    Thanks in advance,
    Glenn

  2. #2
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Basically it means that the object concerned does not support the nominated event. (Quite where 'set' comes from I don't know as the error will be triggered by one event.) I assume this was working in v2003 and now issues an error in v2007, so it's something caused by the upgrade. If you changed no code then my initial thought is that it is a missing or wrong library reference.

    Is there any chance of you publishing the code fragment in which this occurs?

    What is the event? Is it a custom user event expected using the WithEvents keyword?

  3. #3
    Glenn_Suggs is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    72
    Rod, thanks for the response. Actually there's probably too much code behind the "Close" button to post here. I mean it's doing a whole BUNCH of data checking. However, I did find a similar form in the same application that's doing the same thing and is providing a little more information. It says, "Error # 459 was generated by Work Orders (the application). Object or class does not support the set of events at Line# 110. Here is the code at line 110. (It is one of my error handlers using error descriptions and line numbers) Now that I'm revisiting this section of code, I remember the part where the "Undo" statement reverses the changes that have been made on the form. Maybe ACC 2007 doesn't like that part???

    110
    ' Priority must be selected if maintenance required
    If Me.sbfWOV001!chkMaintReq = -1 And _
    (Me.sbfWOV001!cboPriority = "" Or IsNull(Me.sbfWOV001!cboPriority)) Then
    strMsg = "A Priority must be selected for a work order that requires maintenance." & vbCrLf & vbCrLf & _
    "Do you want to abandon any changes and exit anyway?"
    If MsgBox(strMsg, vbYesNo, "Maintenance Required!!!") = vbYes Then
    Me.sbfWOV001.Form.Undo
    Me.Undo
    GoTo lblClose_MouseDownExit
    End If
    DoCmd.CancelEvent
    Exit Sub
    End If

  4. #4
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    The mystery deepens, I can see no events in that code. It is possible with some jiggery pokery to highlight the exact statement that is triggering the error. How familiar are you with debugging techniques?

  5. #5
    Glenn_Suggs is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    72
    I can put a breakpoint in the code to see if I can narrow it down to the line causing the error. I hadn't thought of that. Thanks... Glenn

  6. #6
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Breakpoints - yup, but they're not persistent across sessions. Stop statements do the same as breakpoints and are persistent. Debug.Print if you're tired of pressing F8 and/or want to see more esoteric information.

    Then there's always the Watch window.

    I did some research and the prognostication is not good. Others who have experienced this error have had to resort to reloading Windows and similar traumatic measures. Anyway, here's hoping; the actual statement in error will help a great deal.

  7. #7
    Glenn_Suggs is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    72
    Rod... There's a snag to this situation that I missed yesterday. The application runs ok when running on Windows XP in Access 2007 "as a compiled .accde" file. But when I try it on a Windows 7 machine (and Access 2010), that's when the error shows up. Now it occurs to me that the library references (which include Word, Excel, and Outlook) are pointing to the Microsoft 12.0 Object Libraries in the UNcompiled version, and Windows 7 is able to interpret the object libraries as 14.0 instead of 12.0. So the breakpoints don't do any good because Windows 7 "sees" the object libraries as 14.0, the correct ones for the upgrade. But when Win7 is running the compiled version (accde), I'm thinking it can't tell. I'm not sure about that, but that does seem to be the way it's behaving, all things considered. Does that sound right, or does this not make any sense? Now I'm thinking the issue is one of going from Window XP to Windows 7 entirely. And the users I support may have either OS on their desktop, so the app needs to be able to handle both. Any ideas? Thanks in advance...

  8. #8
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    From what I'm reading here and elsewhere, two things seem to be common:

    - The condition occurs after an upgrade;
    - It seems to be connected with reference libraries and the OS.

    I don't know whether I can help any more since I only have Win 7 (32 bit) and v2007 (i.e. 12.0) with no access to any other OS/version combination. Can you load v 2007 (12.0) on a Win 7 m/c and try it there?

    Have you tried Microsoft themselves? Sometimes they can be surprisingly helpful. Otherwise I'd trawl the Web and try to contact those who have (or have had) similar problems.

    Why can't you change the references to point to v 14.0? What are v 12.0 libraries doing in a v 2010 environment? Or have I missed something? Libraries are usually backward compatible although I've never tried a library from a future OS against the current OS.

    It's a pity you can't narrow it down. Can you introduce Debug.Print statements into the code to at least get an idea in which area the error is generated? Then perhaps refine it even further.

  9. #9
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Just been thinking it over. It would be helpful if you could summarise the situation as follows. Try to keep everything else as constant as possible. Use 12.0 libraries for 2007 and 14.0 libraries for 2010. One case I read believed it to be m/c specific although I'm somewhat dubious about that conclusion.

    v 2007 v2010
    accdb accde accdb accde
    XP ? ? ? ?
    Win 7 ? ? ? ?

  10. #10
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    This looks promising:

    http://allenbrowne.com/bug-17.html

    Also some have suggested that the error may be caused by a naming conflict. Is there a user named object (with events) that now conflicts with a new name in v2007? Sounds a bit farfetched to me.

  11. #11
    Glenn_Suggs is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    72
    Our organization is upgrading from XP with Access 2007 to Windows 7 with Access 2010. I'm one of the few with the upgrade but that's mainly because I'm trying to ensure that my applications will work ok in Win 7. So far, this is the biggest stumbling block. My Windows 7 version works only when compiled with Windows 7/Access 2010. The XP version works only when compiled in that environment. And I am running on two separate machines but from the same compiled app on the network. They just don't jive.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 04-26-2012, 12:14 AM
  2. Object or class does not support the set of events??
    By mejia.j88 in forum Programming
    Replies: 5
    Last Post: 12-12-2011, 12:01 PM
  3. Replies: 1
    Last Post: 09-03-2011, 07:01 PM
  4. Replies: 9
    Last Post: 05-19-2011, 12:08 PM
  5. object or class does not support the set of events
    By couch potato in forum Programming
    Replies: 2
    Last Post: 03-20-2010, 08:55 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums