none
Error: Object invalid or no longer set

    Question

  • While developing an Access 2007 database I am suddenly getting this error -
    Object invalid or not longer set. If I try to break into VBA code with
    CTRL-BREAK it doesn't open any code modules, just repeats the message
    several times which I keep closing. After a decompile/recompile didn't work,
    I started a new blank database and pulled in all but the tables, then linked
    to the tables. The tables are on my PC while I am developing, in a mapped
    drive letter.
    The form with the error has 7 tabbed pages, all have subforms, some having a
    nested subform as well.
    I am having a problem trying to find out the case of the error. I've done a
    lot of recent changes so am not sure what I may have done to cause this.
    Sometimes the error pops up when I am not doing anything in the database -
    it is just open. I have to close the error window several times. As I
    write this the message keeps popping up, goes away for a short time then
    returns. I have timed it - it happens once a minute but I don't have any
    OnTimer settings anywhere! It doesn't happen with the form in design mode,
    so I am sure the problem is with this form or subforms.. I copied the main
    form and replaced the old version with no luck.
    Any other ideas?
     
     

    Michele
    Wednesday, September 14, 2011 7:49 PM

Answers

  • I looked up the refresh interval and it was set at 60 seconds.  I changed it to 30 seconds and now that's how often this message then triggered.  There were no timers in the VBA code, so then I looked through the forms and subforms, converting all macros (there shouldn't have been any) to code.  Still had the error plus another cropped up about a query too complex to evaluate, followed by the 'object invalid..' error.  I found the problem in a combo box where the user selects an item from a combo list showing three columns.  I recreated that simple combo and the error has gone away.  This in between multiple decompiles, compact/repairs, etc.  I think the problem is fixed now so there must have been some corruption in that combo, which is requeried on several different form events.
    Thanks for the tips,
    Mich
     
    "Chris A O'Brien" <=?utf-8?B?Q2hyaXMgQSBPJ0JyaWVu?=> wrote in message news:b5ff82fb-765a-4003-bac8-02e53f433843...

    Don’t know about A2007 but in A2003 the “Refresh interval (sec)” is set to 60.

     

    Could be a coincidence but try setting it to 30; does the failure rate change to 30 seconds?
    Set it back to 60; does the failure rate change back to 60 seconds?

     

    The results of the above tests should indicate if there is a Timer Event involved. (I know you said there wasn’t but the Timer Event and Time Interval might be set in code.)

     

    I guess the next thing to check is Public Objects that may have been set to Nothing in code.

     

    Another thing to check is if you have a Local Object declared with the same name as a Public Object. A Local variable will take scope precedence over a Public variable and the compiler will not pick that up.

     

    Something to check…

     

    Chris.


    Michele
    • Marked as answer by Bruce Song Thursday, September 29, 2011 9:50 AM
    Thursday, September 15, 2011 6:01 PM

All replies

  • Hi Michelle,

    Often if you place too many controls on a form or make many changes to the Form it can become corrupted or your database can be corrupted. This can lead to unusual and unexplaned errors.

    You may need to create a new Form to replace a tab and put all the controls and code for that tab in your new Form.

     


    Patrick Wood Gaining Access http://gainingaccess.net/
    Wednesday, September 14, 2011 9:29 PM
  • Don’t know about A2007 but in A2003 the “Refresh interval (sec)” is set to 60.

     

    Could be a coincidence but try setting it to 30; does the failure rate change to 30 seconds?
    Set it back to 60; does the failure rate change back to 60 seconds?

     

    The results of the above tests should indicate if there is a Timer Event involved. (I know you said there wasn’t but the Timer Event and Time Interval might be set in code.)

     

    I guess the next thing to check is Public Objects that may have been set to Nothing in code.

     

    Another thing to check is if you have a Local Object declared with the same name as a Public Object. A Local variable will take scope precedence over a Public variable and the compiler will not pick that up.

     

    Something to check…

     

    Chris.

    Thursday, September 15, 2011 1:23 AM
  • I looked up the refresh interval and it was set at 60 seconds.  I changed it to 30 seconds and now that's how often this message then triggered.  There were no timers in the VBA code, so then I looked through the forms and subforms, converting all macros (there shouldn't have been any) to code.  Still had the error plus another cropped up about a query too complex to evaluate, followed by the 'object invalid..' error.  I found the problem in a combo box where the user selects an item from a combo list showing three columns.  I recreated that simple combo and the error has gone away.  This in between multiple decompiles, compact/repairs, etc.  I think the problem is fixed now so there must have been some corruption in that combo, which is requeried on several different form events.
    Thanks for the tips,
    Mich
     
    "Chris A O'Brien" <=?utf-8?B?Q2hyaXMgQSBPJ0JyaWVu?=> wrote in message news:b5ff82fb-765a-4003-bac8-02e53f433843...

    Don’t know about A2007 but in A2003 the “Refresh interval (sec)” is set to 60.

     

    Could be a coincidence but try setting it to 30; does the failure rate change to 30 seconds?
    Set it back to 60; does the failure rate change back to 60 seconds?

     

    The results of the above tests should indicate if there is a Timer Event involved. (I know you said there wasn’t but the Timer Event and Time Interval might be set in code.)

     

    I guess the next thing to check is Public Objects that may have been set to Nothing in code.

     

    Another thing to check is if you have a Local Object declared with the same name as a Public Object. A Local variable will take scope precedence over a Public variable and the compiler will not pick that up.

     

    Something to check…

     

    Chris.


    Michele
    • Marked as answer by Bruce Song Thursday, September 29, 2011 9:50 AM
    Thursday, September 15, 2011 6:01 PM