Solved

Handled error break hammers local storage

Posted on 2011-09-23
3
225 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
Comment Utility
<<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
Comment Utility
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

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
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…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

762 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