Link to home
Start Free TrialLog in
Avatar of eliwil
eliwil

asked on

Chasing down errors without that handy debug option

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
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
I agree!
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
... Then, send the focus to the text box which is on the subform before setting the text box to the new value.
Avatar of eliwil
eliwil

ASKER

nailed it!
Dang Mike...I thought you had it!