Acts like there's a "Break" in code when there isn't

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Hi -

I have an Access 2003 application I developed that I've been using for
probably 1 year without any problems. I recently modified the code that was
executed when one of the command buttons is clicked. While doing the
modifications, I inserted a break and stepped through the code several times
to find a problem I was having. Now I have removed the break, but when I
click the button VBA opens up and the code stops until I hit play or step
through it. Also, I can close the code and hit the command button again and
it will run without stopping. The problem has carried over to a few of the
other buttons as well even though I haven't modified their code at all.

Anyone have any thoughts what might be happening and how to stop it? The
application works fine, but its confusing some of our users when they see all
the VBA code pop up on their screen.

Thanks!
 
We've all been bit by 'phantom breakpoint'.

A quick fix: Copy the line where the code breaks at, let the code run to
completion, then delete that line & the surrounding line (not strictly
necessary but to be safe) then paste that code back into. That will
usually clear up the phantom breakpoint.

On prevention side, try to avoid editing the line where there is a
breakpoint or saving the file with breakpoint left in. Some also
suggests not editing the code while it is running.

HTH.
 
I've also gone back and reset the breakpoint then let the code run to the
break point, having it stop and then continuing. Then clearing it and
Debugging.

The STOP keyword is a viable alternative.
 
Back
Top