Solved

Chasing down errors without that handy debug option

Posted on 2007-03-30
7
217 Views
Last Modified: 2012-08-14
I'm getting this error "The expression you entered refers to an object that is closed or doesn't exist" on one tabbed forms with multiple subs. And, "You entered an expression that has an invalid areference to the property Form/Report" on another. Is there a good way to debug? Or very common offenders that are a good place to start?

It's so much easier when the error message gives you a debug option that takes you to a line of code. I'm hoping there is some nifty way to narrow down the offender. The way I've been doing it is very slow going. I just start eliminated sub by sub and then control by control until I find the problem.

I'm going to be without an internet connection for the next several hours but I will be checking back in this evening to followup.

E
0
Comment
Question by:eliwil
7 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
Comment Utility
In your VBA code window, go to Tools menu: Options
Click on Advanced tab
Set the Error Trapping option group to 'Break on All Errors'.

Save, close, and re-run.
When the error occurs again, this time code execution will stop on the line that cases the error.
0
 
LVL 34

Expert Comment

by:jefftwilley
Comment Utility
Every error has to begin with an event. You can always put a Breakpoint at the origin of the event in your code, then step through your code using <F8> from there. Your code (from what I've seen) uses a lot of FORMS! references and chances are, you're trying to set a value when the form is unavailable, or is named incorrectly. Shouldn't be too hard to find.
0
 
LVL 44

Expert Comment

by:GRayL
Comment Utility
I agree!
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 33

Expert Comment

by:Mike Eghtebas
Comment Utility
Because you haven't described the operation causing this error, I will make a guess (forgive me if I am wrong about it). For whatever worth, I am going described a situation and offer asolution to handle this kind of errr.

Operation: You are trying to update the information in a text box via code and you are getting this error.

Solution: Set the focus to the subform if the text box is on the subform and your code is not on the subform. Then, send focus to the text box before setting the text box to the new value.

Mike
0
 
LVL 33

Expert Comment

by:Mike Eghtebas
Comment Utility
... Then, send the focus to the text box which is on the subform before setting the text box to the new value.
0
 

Author Comment

by:eliwil
Comment Utility
nailed it!
0
 
LVL 34

Expert Comment

by:jefftwilley
Comment Utility
Dang Mike...I thought you had it!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

763 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

6 Experts available now in Live!

Get 1:1 Help Now