Break Points Do Not Clear

S

ScottS

I was wondering if anyone else has encounter this problem.

When I test my code (usually in a form) I will set break points so I can
step through critical parts of a procedure. When I am done I clear all the
break points, compile, and save. When I attempt to run the program as the
user would it stops and displays the VBA Editer stopped at previous break
point in debug mode, yet no break point has been set.

Any idea?

Thanks in advance for any help you can offer.
 
D

Dirk Goldgar

ScottS said:
I was wondering if anyone else has encounter this problem.

When I test my code (usually in a form) I will set break points so I can
step through critical parts of a procedure. When I am done I clear all
the
break points, compile, and save. When I attempt to run the program as the
user would it stops and displays the VBA Editer stopped at previous break
point in debug mode, yet no break point has been set.


I've seen that happen. My impression is that it tends to happen when you
modify code while the form is running (that is, open in form view), rather
than stopping the code, switching to design view, making and saving your
changes, and then reopening the form. However, I can't swear to that.

A way to fix the phantom breakpoints was 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 ---------

If that doesn't work, you could always decompile the project. Here's how:

--------- How to decompile ----------
1. With the database closed -- no users in it at all -- and (ideally) Access
not running, make a backup copy.

2. On the task bar, click Start -> Run...

3. Enter this (adapted to match your database path and name) in the Run
dialog box and click OK:

msaccess.exe /decompile "C:\My Documents\YourDBName.mdb"

You may need to include the full path to msaccess.exe, but I don't find that
to be the case when I try it. Depending on your Access version, you may not
get any sign that anything in particular happened. Your database will
probably open in Access.

4. Compact and Repair your database.

5. Open the database again, press Alt+F11 to switch to the VB Editor, and
click Debug -> Compile (your project). If any errors appear, fix them and
recompile.

6. Close the VB Editor. Compact & Repair again.

See if the problem has disappeared.
--------- end topic ----------
 
R

Robert Morley

In addition to Dirk's methods, if there only seems to be one, you can
usually clear it by placing & clearing a breakpoint on the same line as the
phantom breakpoint.


Rob
 

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