Solved

invalid object or no longer set

Posted on 2013-02-05
9
440 Views
Last Modified: 2013-02-05
When opening a form via another one I get the error "invalid object or no longer set". When I click on ok it reappears. It seems it's in a perpetual loop and I have to kill the db via task manager.

How do I get out of this loop without killing access and how do I find the culprit in my code?
0
Comment
Question by:Shawn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 21

Expert Comment

by:oleggold
ID: 38856263
0
 
LVL 21

Expert Comment

by:oleggold
ID: 38856264
0
 
LVL 21

Expert Comment

by:oleggold
ID: 38856265
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 21

Expert Comment

by:oleggold
ID: 38856266
0
 
LVL 21

Expert Comment

by:oleggold
ID: 38856267
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 250 total points
ID: 38856417
What is the code you are using to do this?

Generally, that error implies that you are attempting to perform an action or a method of an object that may have been destroyed (set obj = Nothing).

If you open that 2nd form from the navigation pane (database window), without the calling form, does it open properly?
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 250 total points
ID: 38856633
<how do I find the culprit in my code? >
Not sure,..
How about actually posting the code you are using...?
;-)


I agree with fyed...
For me, it ends up that I never SET the object in the first place:
Dim rst as dao.database
rst.movefirst

When it should be:
Dim rst as dao.database
set rst=currentdb.openrecordset("MyTable")
rst.movefirst

;-)

JeffCoachman
0
 
LVL 1

Author Comment

by:Shawn
ID: 38856656
on the buttion to open the new form before actually opening the new form it performs a requery to the main form. I just did a refresh on this form and am getting the same problem. This main form has 3 subforms and it seems one of them is causing the problem.

I am check the references now. Will post code once I've narrowed it down a little.
0
 
LVL 1

Author Closing Comment

by:Shawn
ID: 38857464
Found the source. The refresh was creating a loop and reloading a recordset. Since I hadn't closed it properly it was eventually getting an error of too many tables.

Sorry I didn't post any code but I really had no idea where to start...too many things going on. At least you pushed me in the right direction.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question