Solved

invalid object or no longer set

Posted on 2013-02-05
9
429 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
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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

830 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