Solved

Chasing down errors without that handy debug option

Posted on 2007-03-30
7
221 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
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

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…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

828 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