Solved

Chasing down errors without that handy debug option

Posted on 2007-03-30
7
223 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
[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
7 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 18826510
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
ID: 18826816
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
ID: 18827250
I agree!
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 18827269
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 34

Expert Comment

by:Mike Eghtebas
ID: 18827273
... 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
ID: 18827656
nailed it!
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18827667
Dang Mike...I thought you had it!
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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

752 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