none
Object or class does not support the set of events

    Question

  • Hi,

    I have a strange error which appears on the one PC only. This is a new PC but with the same configuration as others (WinXP, Access 2003).

    When this user launch the application, it fails with the standard MS Access message box about "The expression On Open you entered bla-bla-bla". So, it looks like an unhandled error. But! What I actually have in Open Event of my StartUp form:

    Private Sub Form_Open(Cancel As Integer)
    On Error GoTo err_lbl
        Set CU = New clsCurrentUser
        If (Right(CurrentProject.Name, 3) = "mde") And (CurrentProject.Path & "\" <> Environ("mydocuments") & "\Desktop\blabla") Then
            MsgBox "bla-bla!", vbCritical, "MyApp"
            Application.Quit acQuitSaveNone
        End If
        Me.TimerInterval = 1
    exit_lbl:
        Exit Sub
    err_lbl:
        MsgBox UDM(DBEngine.Errors), vbCritical, "MyApp"
        Resume exit_lbl
    End Sub

    This error seems to be related to my clsCurentUser class. The code of Initialize Sub is the following:

    Private Sub Class_Initialize()
    Dim rs As DAO.Recordset, rs1 As DAO.Recordset
    On Error GoTo err_lbl
        m_UserName = Environ("USERNAME")
        m_Computername = Environ("COMPUTERNAME")
        Set rs = CurrentDb.OpenRecordset("SELECT * FROM tEmployees_dic WHERE EmployeeID = """ & m_UserName & """", dbOpenSnapshot)
        With rs
            m_IsEmpty = .BOF And .EOF
            If Not m_IsEmpty Then
                m_FullName = Nz(.Fields("EmployeeFIO").Value)
                m_AccessLevel = Nz(.Fields("ALevel").Value, 5)
                m_NativeBranch = Nz(.Fields("NativeBranch").Value)
                If m_NativeBranch <> vbNullString Then
                    Set rs1 = CurrentDb.OpenRecordset("SELECT tRegions_dic.RegionID, tCities_dic.CityID " _
                    & "FROM tRegions_dic INNER JOIN (tCities_dic INNER JOIN tBranches_dic " _
                    & "ON tCities_dic.CityID = tBranches_dic.CityID) ON tRegions_dic.RegionID = tCities_dic.RegionID " _
                    & "WHERE tBranches_dic.BranchID = """ & m_NativeBranch & """", dbOpenSnapshot)
                    m_NativeRegion = Nz(rs1.Fields(0).Value)
                    m_NativeCity = Nz(rs1.Fields(1).Value)
                    rs1.Close
                Else
                    m_NativeRegion = 32767
                    m_NativeCity = 32767
                End If
            End If
            .Close
        End With
    exit_lbl:
        Exit Sub
    err_lbl:
        MsgBox UDM(DBEngine.Errors), vbCritical, "MyApp"
        Resume exit_lbl
    End Sub
    All the info I found about this error is related to WithEvents etc. But I do not use it. Does anybody know where to look for the error source? Why error handling does not fire?

    Andrey V Artemyev | Saint-Petersburg, Russia
    Russian blog artemyev.biztoolbox.ru

    Wednesday, March 28, 2012 8:46 AM

Answers

  • Perhaps the msacc.olb is in some way corrupted.

    You can try to copy it from a machine where the procedure works correctly and be sure that is not from another access version.

    I'm insisting on this point because a few days ago I've had the same problem and I solved it in this way.

    Wednesday, March 28, 2012 9:34 AM

All replies

  •  

    If (Right(CurrentProject.Name, 3) = "mde")

    Is this an mde file? or are you testing in mdb? or does it matter?


    Chris Ward

    Wednesday, March 28, 2012 8:54 AM
  • Hi Andrey V Artemyev,

    if you are using access2003 check in the references that the object library in use is Microsoft Access 11.0

    HTH Paolo

    Wednesday, March 28, 2012 9:00 AM
  • Chris,

    the only one user has this error and yes, he runs .mde. But this part is not important I think, because it just tests whether the application is launch from the folder which is on Desktop.

    Paolo,

    yes, this library is here.


    Andrey V Artemyev | Saint-Petersburg, Russia
    Russian blog artemyev.biztoolbox.ru

    Wednesday, March 28, 2012 9:04 AM
  • So the On Open has to do with only the 1st part of your posted code right?

    Does it matter that there is only one part of an argument?

    If this then, Else?


    Chris Ward

    Wednesday, March 28, 2012 9:14 AM
  • Perhaps the msacc.olb is in some way corrupted.

    You can try to copy it from a machine where the procedure works correctly and be sure that is not from another access version.

    I'm insisting on this point because a few days ago I've had the same problem and I solved it in this way.

    Wednesday, March 28, 2012 9:34 AM
  • Chris,

    this part of code is ok. If a user launches the application not from the place mentioned in code, he can see a message "Please, use a shortcut only!" and application is being immediately closed. Otherwise, if it is launched via shortcut, the StartUp is then being opened.

    Paolo,

    thanks for the suggestion. The only problem is that I'm not an IT dept employee and it would be an infinite trip to check smth in a hidden C drive, especially keeping in mind that this problem user is in another city. But I've already asked him to check whether Office 2003 is installed alone or with Office 2010 simultaneously. I'll provide further details as soon as I receive an answer from him.


    Andrey V Artemyev | Saint-Petersburg, Russia
    Russian blog artemyev.biztoolbox.ru

    Wednesday, March 28, 2012 11:54 AM
  • Does the client's machine have the same maintanence level as yours -- Access and XP?

    Are there any ActiveX controls on the form?  If so check the GUID(s) on your machine and see if the client has the same ones.  You can get the GUID(s) by using SaveAsText to save the from as a text file.


    http://www.saberman.com

    Wednesday, March 28, 2012 3:25 PM
  • Does the client's machine have the same maintanence level as yours -- Access and XP?

    Are there any ActiveX controls on the form?  If so check the GUID(s) on your machine and see if the client has the same ones.  You can get the GUID(s) by using SaveAsText to save the from as a text file.

     Yes, but it may be possible it has both A2010 and A2003, I hope my user will reply tomorrow about this.

    BTW, yes, ActiveX control! It is a ProgressBar (or however it is called, I dpn't exactly remeber). Worth to check it, thanks!


    Andrey V Artemyev | Saint-Petersburg, Russia
    Russian blog artemyev.biztoolbox.ru

    Wednesday, March 28, 2012 4:23 PM
  • Fresh info:

    Paolo,

    the user's PC has Office 2003 installed only. Could you provide me a full path to msacc.olb? I have no direct access to the system drive, I'll catch with .bat script.

    saberman,

    I checked GUID in my .mdb file:

    OLEClass ="ProgCtrl"
    Class ="MSComctlLib.ProgCtrl.2"
    GUID = Begin
        0x183459e4683ff143a76f612190b5dc25
    End
    Is it possible that GUID in user's .mde (which was made on my PC) differs from mine?

    Andrey V Artemyev | Saint-Petersburg, Russia
    Russian blog artemyev.biztoolbox.ru

    Thursday, March 29, 2012 8:44 AM
  • The default path where you can find the msacc.olb is

    C:\Program Files\Microsoft Office\OFFICE11

    Did you verify on the user machine that it's using Microsoft Access 11.0 object library?

    Thursday, March 29, 2012 9:15 AM
  • It's become a kind of madness.

    Now I can say that this error appears right after this StartUp form is being called. No one of form's events do not fire. I tried to list all the references but it is impossible, this error appears before any code runs.

    I created a blank form, add the simple For Each ref in Application.References piece of code and made this form a StartUp form. After luanching the app, there are 2 errors:

    err1 err2

    And then nothing happens.

    Maybe it's time to re-install the whole Office suite?


    Andrey V Artemyev | Saint-Petersburg, Russia
    Russian blog artemyev.biztoolbox.ru

    Thursday, March 29, 2012 10:56 AM
  • If you can reinstall the whole suite I'm sure the problem will be solved.

    I know you're not on the faulty machine otherwise you can start your app with the shift key and see the references.

    FYI you can read something interesting about your error following this link that I found googling the error

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

    Thursday, March 29, 2012 11:24 AM
  • Sounds to me like the "old" VBA 7.0 compatibility problem when using both Access2010  and an older version (older than 2007). In fact, that error could occur for any code behind a form in, say, Access 2003 imported to a buggy Access 2010 environment. (And I would avoid using A2010 64 bits under that scenario).

    Be sure to have the latest updates (for Access 2010 on that PC);

    Compact the imported Access 2003 project from the command line;

    That should do. (Avoid using Access 2003 if the problem comes back, if possible, on that PC).

    Monday, April 02, 2012 7:15 PM
  • Vanderghast,

    the problem is that there is A2003 only on this PC. I used to think there are 2003 and 2010 because a lot of our users have both Office 2010 and Office 2003 installed in process of migration to Office 2003. But interesting, this PC has only Office 2003.

    However, one of our admins said he would re-install the system completely (both Windows ans Office). I'll ask him tomorrow and let you know the result as soon as I receive an answer. 


    Andrey V Artemyev | Saint-Petersburg, Russia
    Russian blog artemyev.biztoolbox.ru

    Monday, April 02, 2012 7:46 PM
  • Hi Andrey
    How about the problem on your side? Do you still need any assistant about the problem? If you still show any concern on the problem, just feel free to let us know.
    Best Regards,

    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us

    Friday, April 06, 2012 5:40 AM
  • Hi Bruce,

    I've got a reply from IT engineer, he re-install the whole system on this PC. Now I'm still waiting for this user tries to launch the application. Seems she has a day-off. I'll definitely reply here as soon as I contact her.


    Andrey V Artemyev | Saint-Petersburg, Russia
    Russian blog artemyev.biztoolbox.ru

    Friday, April 06, 2012 7:00 AM
  • I still have no reply from the user and I tend to consider this fact as the issue has gone away. I marked Paolo's reply as an answer because it had turned me to the right direction: the issue was with the PC itself rather than with my application.

    If the problem appears again, I'll be back with more details.

    Thanks all for your support!


    Andrey V Artemyev | Saint-Petersburg, Russia
    Russian blog artemyev.biztoolbox.ru

    Tuesday, April 17, 2012 8:17 AM
  • Just FYI,

    1. This problem was solved, of course, by reinstalling the whole Windows.

    2. Today I faced the same problem but in my dev .mdb file. It is an ActiveX Progress Bar control. I don't know the reason, maybe some Windows updates were installed this weekend, but I solved the issue by decompiling, compiling again and C&R.


    Andrey V Artemyev | Saint-Petersburg, Russia
    Russian blog artemyev.biztoolbox.ru

    Monday, October 08, 2012 12:55 PM
  • I've been facing the problem for a couple of years. Exactly from the times Office 2010 began to exist on some PCs in our company. Finally, we have decided to install a separate copy of Office 2003 having Office 2010 Standard (instead of Professional) still installed.

    It was a rather good solution and everybody was happy. Until thin client appeared. There we should use Office 2010 only. And an hour ago I found a solution. The problem application should be decompiled, then compiled on the PC with Office 2010 and the OS matched. And it's very important, .mde file should be prapared on the same PC, i.e. on the PC which has the same OS, Office and updates as the targer user's PC. In this case all works fine. Except one thing, this .mde does not work on Access 2003 PC anymore. :) So, two versions (at least) should be maintained anyway.

    And yes, the errors like this one often appear after updates installation. And they appear for forms with ActiveX controls only.

    I hope we'll move to Office 2010 finally all over the PCs in a couple of months and I will forget this nightmare. 


    Andrey V Artemyev | Saint-Petersburg, Russia

    Thursday, March 13, 2014 12:29 PM