The Expression On Open you entered.......Help!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • philelpko
    New Member
    • Nov 2006
    • 31

    The Expression On Open you entered.......Help!

    So close to finishing and then this error jumped out at me:

    "The expression On Open you entered as the event property setting produced the following error: Member already exists in an object module from which this object module derives"

    This has been caused by the (extremely enjoyable) exporting of my database into another despite me making sure that all reference .dll files where added and copied to the correct locations.

    I think I understand what the error is caused by but I cant find the problem as the debugger is sod all use as it never gets the chance to kick in.

    To test the problem I edited out "Form_Open" , the error was still there but now moved onto the next event "On Load". After I had edited out all "On **" events which activate before the form opens, the form finally loads. I then attempted to add the "On Open" event back in with no code in it.

    i.e.

    Private Sub Form_Open(Cance l As Integer)

    End Sub

    Impressively it still doesnt like this despite there being no code in it???

    I am sure that I have gone through the form's code and checked that their are no clashes with the other database's modules but I am at a loss.

    Any pointers???

    Cheers for any help :)
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    Originally posted by philelpko
    So close to finishing and then this error jumped out at me:

    "The expression On Open you entered as the event property setting produced the following error: Member already exists in an object module from which this object module derives"

    This has been caused by the (extremely enjoyable) exporting of my database into another despite me making sure that all reference .dll files where added and copied to the correct locations.

    I think I understand what the error is caused by but I cant find the problem as the debugger is sod all use as it never gets the chance to kick in.

    To test the problem I edited out "Form_Open" , the error was still there but now moved onto the next event "On Load". After I had edited out all "On **" events which activate before the form opens, the form finally loads. I then attempted to add the "On Open" event back in with no code in it.

    i.e.

    Private Sub Form_Open(Cance l As Integer)

    End Sub

    Impressively it still doesnt like this despite there being no code in it???

    I am sure that I have gone through the form's code and checked that their are no clashes with the other database's modules but I am at a loss.

    Any pointers???

    Cheers for any help :)
    Try after backing up ur database:

    Go in form properties and especially to Has module property

    Turn it off!

    then recreate all events in ur form!

    Comment

    • philelpko
      New Member
      • Nov 2006
      • 31

      #3
      Originally posted by PEB
      Try after backing up ur database:

      Go in form properties and especially to Has module property

      Turn it off!

      then recreate all events in ur form!
      Cheers for the help. Gave it a try but with no success.

      Found the problem a few mins ago. I cut all the code out of the form and pasted it back in bit by bit (not a fun job, it was over 60 pages long in word!)

      The offending sub was called - Private Sub CarClaimCost()

      I have no idea why it is clashing with anything but as soon as it is removed the form loads fine.

      Still totally confused but at least I can get around it.

      Cheers again for the help :)

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32662

        #4
        Sometimes Access gets its knickers in a twist :(.
        When this happens I :
        1. Cut my code out and save it in a text editor.
        2. Save offending object.
        3. RePaste code back into object.
        4. Compile project.

        Normally works after that.

        Comment

        • InterimResources
          New Member
          • Nov 2008
          • 1

          #5
          I found my answer on ** Link to competing forum removed as per site rules **
          In short; refresh all your references (When working on different computers this migth also be your solution)
          GRTZ Jeroen
          Last edited by NeoPa; Nov 19 '08, 02:15 PM. Reason: Removed link

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32662

            #6
            We appreciate your posting your answer Jeroen, but unfortunately (I'm sure accidentally) your link violates our rules so I've had to remove it.

            Nevertheless, we like your thinking and welcome to Bytes!

            Comment

            Working...