[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

invalid object or no longer set

Posted on 2013-02-05
9
Medium Priority
?
454 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 21

Expert Comment

by:oleggold
ID: 38856267
0
 
LVL 48

Accepted Solution

by:
Dale Fye earned 1000 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 1000 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

649 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