Solved

invalid object or no longer set

Posted on 2013-02-05
9
401 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
 
LVL 21

Expert Comment

by:oleggold
ID: 38856266
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now