Breakpoints in VBA (Opposite of below)

D

dymondjack

I'm curious if anyone else has this issue or knows what can be done about it...

Access '03

Rather than having Breakpoints that do not respond, I continually have
issues with breakpoints that have been removed, yet still break when the code
runs. The only surefire way for me to get rid of this is to import
everything into a fresh db (though occasionally it does seem to fix itself).

I've tried the obvious (remove all breakpoints, or manually go through and
remove everything) and it doesn't help. I've tried recompiling the project
after removing the bp's (enter a blank line, delete it, compile), but that
doesn't seem to do anything either.

So I think this has to be happening one of two ways, either
a) I forget to remove the bp before closing the project, or
b) I compile the project without first removing all the bp's

Obviously, remembering to remove any breakpoints before compiling a project
can be fairly tedious, especially if it causes this issue that cannot seem to
be fixed without importing everything into a new db.

Any thoughts?

--
Jack Leach
www.tristatemachine.com

- "A designer knows he has reached perfection not when there is nothing left
to add, but when there is nothing left to take away." - Antoine De Saint
Exupery
 
S

strive4peace

Hi Jack (is that your name?)

check this setting:

from a VBE window: Tools, Options, General tab

what is 'Error Trapping' set to? I have mine set to -->
Break on Unhandled Errors

if you have it set to Break on All Errors, that is the problem

since defaults are for your environment and not a specific database,
this setting will affect anything you work with in Access until you
change it


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
S

strive4peace

if this is not the problem...

'~~~~~~~~~ Decompile ~~~~~~~~~

if you have odd behavior, backup your database and then decompile it

make an make a "generic" decompile icon where the next database you open
will be decompiled... use this as the target:

"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" /decompile

if your Access program is not located in the directory specified, make
the appropriate substitution

the next database you open will be decompiled... you can verify this by
going to the design view of any module -- Compile will not be gray, it
will be available

then, compile the database
then, do compact/repair
'~~~~~~~~~ ~~~~~~~~

to make a Decompile icon:

Open Windows Explorer
(right-click on [Start], choose 'Explore'

scroll to the top of the left pane

right-click on Drive C:
choose --> Search

look for -->
MSACCESS.EXE

once you see where the program is located, navigate to MSACCESS.EXE
using Windows Explorer

then right-click on MSACCESS.EXE and choose -->
SendTo > Desktop (create shortcut)

then, right-click on the desktop icon you just made and choose -->
Properties

1. click on the 'Change Icon' command button -- so it doesn't look like
a regular Access icon (I use the 2 inerlocking circles one screen to the
right on the top row)

2. click in the Target textbox
press the [End] key to move to the end of the line
then, add this to the end of the target -->
/decompile




Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
D

Dirk Goldgar

dymondjack said:
I'm curious if anyone else has this issue or knows what can be done about
it...

Access '03

Rather than having Breakpoints that do not respond, I continually have
issues with breakpoints that have been removed, yet still break when the
code
runs. The only surefire way for me to get rid of this is to import
everything into a fresh db (though occasionally it does seem to fix
itself).

I've tried the obvious (remove all breakpoints, or manually go through and
remove everything) and it doesn't help. I've tried recompiling the
project
after removing the bp's (enter a blank line, delete it, compile), but that
doesn't seem to do anything either.

So I think this has to be happening one of two ways, either
a) I forget to remove the bp before closing the project, or
b) I compile the project without first removing all the bp's

Obviously, remembering to remove any breakpoints before compiling a
project
can be fairly tedious, especially if it causes this issue that cannot seem
to
be fixed without importing everything into a new db.

Any thoughts?


This happens to me occasionally, though not often. I *think* it's probably
caused, at least sometimes, by editing code in break mode. I try never to
do that, but sometimes I forget. It is not specifically caused by clearing
breakpoints before closing the project, and I don't think it's consistently
caused by compiling without first removing breakpoints. However, I have not
really pinned down the cause or causes.

As for curing a case of phantom breakpoints, I've usually succeeded by
modifying a line of code inconsequentially (as you described above), then
clicking Debug -> Clear All Breakpoints, then compiling the database, then
clicking the Save button.

If that doesn't work, you can try this procedure posted by "'69 Camaro", aka
Gunny, on 13 January 2005:

--------- begin quoted post ---------
To fix it, open the database, then open the form in Form View. Press
<ALT><F11> to open the VB Editor. Click the "Reset" button on the toolbar
three times. (Answer to question I know you are going to ask: Because
sometimes twice just isn't enough.) Select the Debug menu -> Compile
<DatabaseName>, just in case the code wasn't already compiled.

Press <ALT><Q> to return to Access. Select the Tools menu -> Database
Utilities -> Compact and Repair Database to compact the database. When
finished, close the database. Open the database again and open the form in
Form View, then enter text into the field that has recently been causing the
problem. The problem should be gone because you've removed the ghost
breakpoint.
--------- end quoted post ---------

And if *that* doesn't work, you can use the lightly-documented /decompile
command-line option. To decompile your database, make a backup first, and
then run the following command line:

msaccess.exe /decompile "C:\Your Path\YourDBName.mdb"

Depending on your Access version, you may not get any sign that anything in
particular happened. Your database will probably open in Access. At that
point, Compact and Repair your database, then when it reopens, go to the VB
editor and compile it again. That ought to do it.
 
R

RoyVidar

dymondjack said:
I'm curious if anyone else has this issue or knows what can be done
about it...

Access '03

Rather than having Breakpoints that do not respond, I continually
have issues with breakpoints that have been removed, yet still break
when the code runs. The only surefire way for me to get rid of this
is to import everything into a fresh db (though occasionally it does
seem to fix itself).

I've tried the obvious (remove all breakpoints, or manually go
through and remove everything) and it doesn't help. I've tried
recompiling the project after removing the bp's (enter a blank line,
delete it, compile), but that doesn't seem to do anything either.

So I think this has to be happening one of two ways, either
a) I forget to remove the bp before closing the project, or
b) I compile the project without first removing all the bp's

Obviously, remembering to remove any breakpoints before compiling a
project can be fairly tedious, especially if it causes this issue
that cannot seem to be fixed without importing everything into a new
db.

Any thoughts?

After ensuring no code is running, adding and deleting one empty line,
then compile, is usually sufficient.

If not, I've used /decompile.

Removing breakpoints;
F9 - toggle one
Ctrl+Shift+F9 - Clear all breakpoints
 
D

dymondjack

Thanks for the input everyone, though it seems everyone else has the same
idea I do on it.

I think this must be stemming from editing code in break mode (I try not to,
but do catch myself and have to slap my hand here and there).

I haven't tried the decompile method yet, though I've been meaning to for
other reasons since I came across it a month or two ago. Some other
suggestions work, but unfortunately not always.

Thanks anyway!

--
Jack Leach
www.tristatemachine.com

- "A designer knows he has reached perfection not when there is nothing left
to add, but when there is nothing left to take away." - Antoine De Saint
Exupery
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top