Solved

invalid object or no longer set

Posted on 2013-02-05
9
420 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server views 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 Microsoft Access…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

832 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