Solved

Handled error break hammers local storage

Posted on 2011-09-23
3
227 Views
Last Modified: 2012-06-21
I am enccountering something that has been evolving from a simple annoyance to a problem that I will have to deal with.
I am working in Access 2007/accdb for clients (although I have 2010 32 bit on my home machine).
If my apps break on a handled error, it appears to hammer many, if not all, of my public variables and custom classes.
This is a PITA for me while developing, since I find that I have to close the app and then re-open it to reinitialize the objects. In production it means that a user should probably close and then re-open the app if they ever get an error message; which lacks grace.
I incorporate message handling in every subroutine and function except class modules, where I apply situational discretion as to how an error is handled. I have a public HandleError function that takes care of the paperwork.
My default is to have my errors break in class modules, which I enforce when I open the app with the following:

      Application.SetOption "Error Trapping", enmBreakInClassModules

Is this normal behavior? For some reason I don't recall this being as much of an issue in years past. My impression is that this is something that has come more to the fore in 2007 and 2010.
0
Comment
Question by:shambalad
  • 2
3 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 36587600
<<If my apps break on a handled error>>

  If you reset at that point (stop execution), everything clears.  That's no different then it always has been.

Jim.
0
 
LVL 7

Author Comment

by:shambalad
ID: 36587682
I think this is happening even if I don't do a reset; but, to be honest, I'm not sure (knowing myself, you've probably identified what it is I've been doing).
So...
I'm going to accept your answer, and keep your advice in mind. If my experience differs. I will revisit.
Thanks,
Todd
0
 
LVL 57
ID: 36587765
Todd,

<<I think this is happening even if I don't do a reset; but, to be honest, I'm not sure (knowing myself, you've probably identified what it is I've been doing). >>

  It should not be happening if you are not resetting.  Simply breaking execution is a pause (you have a breakpoint on the line, have told VBA to break, or have a STOP in the code).

  When your at a break, you can hit F8 to step through code line by line or F5 to simply continue.

  But if you do Run/Reset off the menbar or hit the Square on the toolbar, then your resetting executiona nd everything will clear.

Jim.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

831 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