M
MikeC
Earlier this evening, I discovered that my breakpoints
completely stopped working in one of my AXP databases. I
could no longer debug code.
I looked to see if I clicked the wrong button by mistake.
That wasn't it, so I restarted my machine. That didn't
fix it. I compacted and repaired. I decompiled and
recompiled. None of these had any effect.
After retracing my steps, I found that the cause was a new
function I was running during the Open event of my
switchboard form that opens during startup. My function
gets the original values of some Access options, saves
them in public variables, and then temporarily sets the
options the way I want them to be. Later, when the
database is closed, I restore the original options.
The function appears to work fine and without errors.
Anyway, I found that when I commented-out this new
function, I was able to set breakpoints and resume
debugging my code.
The strange thing is that I *UN-commented* the function
without making any programmatic changes to see what would
happen. My breakpoints continued to work correctly.
Now I'm wondering if the source of the problem has
something to do with the below note I found in the online
VBA help.
"Set Options from Visual Basic" (toward bottom of page)
"Note If you are developing a database application, add-
in, library database, or referenced database, make sure
that the Error Trapping option is set to 2 (Break On
Unhandled Errors) when you have finished debugging your
code."
I have not seen this option in VBA and had believed that
my error handling (On Error GoTo ...) would detect any
runtime errors. Is this not true? Has anyone observed
the above problem in Access VBA?
completely stopped working in one of my AXP databases. I
could no longer debug code.
I looked to see if I clicked the wrong button by mistake.
That wasn't it, so I restarted my machine. That didn't
fix it. I compacted and repaired. I decompiled and
recompiled. None of these had any effect.
After retracing my steps, I found that the cause was a new
function I was running during the Open event of my
switchboard form that opens during startup. My function
gets the original values of some Access options, saves
them in public variables, and then temporarily sets the
options the way I want them to be. Later, when the
database is closed, I restore the original options.
The function appears to work fine and without errors.
Anyway, I found that when I commented-out this new
function, I was able to set breakpoints and resume
debugging my code.
The strange thing is that I *UN-commented* the function
without making any programmatic changes to see what would
happen. My breakpoints continued to work correctly.
Now I'm wondering if the source of the problem has
something to do with the below note I found in the online
VBA help.
"Set Options from Visual Basic" (toward bottom of page)
"Note If you are developing a database application, add-
in, library database, or referenced database, make sure
that the Error Trapping option is set to 2 (Break On
Unhandled Errors) when you have finished debugging your
code."
I have not seen this option in VBA and had believed that
my error handling (On Error GoTo ...) would detect any
runtime errors. Is this not true? Has anyone observed
the above problem in Access VBA?