Debugger bugging me!

groengoen

Registered User.
Local time
Today, 18:31
Joined
Oct 22, 2005
Messages
141
Why would the debugger continue stop at a certain part of the VBA after I have taken away the break? Any ideas?
 
Go into the VBE for the project and hit <CTRL><SHIFT><F9>, or go Debug|Clear All Breakpoints.
 
I tried both of those without success!
 
a slightly different thing but something to watch out for: in the vb editor go to:
tools - options - general tab - error trapping:
see which one is checked -- 'break on unhandled errors' or 'break on all errors'.

i had to turn on 'break on all errors' for something once and forgot to turn it off. took a while before i realized the problem.
 
I call these phantom breakpoints. The only way I have been able to remove them is by deleting a section of code that contains them, saving the module, compiling, and then pasting the code back where it was.


I did just that and the breakpoint is still there.
 
You should "Decompile" your application ... to do that launch your db from a short cut with a target that looks something like this ...

MSACCESS.EXE "C:\Fullpath\NameofDb.MDB" /excl /decompile

Upon launch, Access will strip all the compiled code from your db. You then need to go in to the VBA editor and Compile the code ...

Note that there is no message that says something like "Your app has been Decompiled" ... it will just launch in a fashion which appears to be normal. But when you go into the VBA editor, you will see that the Compile option is NOT grayed out, thus indicating a compile operation is needed.

...

By the way, if memory serves me correctly, this type of phenomenon seems to be centered around compiling the code with a breakpoint set.
 
Last edited:
dumb thought, but are you sure there isnt an error in the code/compilation
 
You should "Decompile" your application ... to do that launch your db from a short cut with a target that looks something like this ...

MSACCESS.EXE "C:\Fullpath\NameofDb.MDB" /excl /decompile


By the way, if memory serves me correctly, this type of phenomenon seems to be centered around compiling the code with a breakpoint set.

Thanks for that datAdrenaline, but I still have the breakpoint, after going through that procedure. Also the compile is clean, Gemma_the_husky. I also don't think I compiled it with a breakpoint set.
 
Can you post your database the is exhibiting the problem? ... Are you sure that you were only one in the db when you tried to decompile it?
 
does the debugger stop in the code while the code is running

if its not a breakpoint, then it may be a syntax error, or something similar

is the line highlighted in yellow (i think) - if so, hover over the various variables on the line until you find the one causing the issue

-----
or PUT a breakpoint in just before the problem, and step through the code to see what happens
 
Gemma was right. I had a command "stop" in the the end of a "Select Case ...End Select" sequence. I don't know why!, but it was highlighted in yellow, but compiled ok. When I removed it all was well. Thanks for all that.

However, after all the compiling and de-compiling, my database is in some mode where it won't let me amend anything. It is as if it is in read-only mode. Any ideas?
 
So you're saying it wasn't a break point at all, that it was code executing exactly the way it was written?

Note to self: don't answer posts about break points if the code with the line in question is not posted.
 
And as a general reference, don't bother with 'Stop' command. They are permanent and can be a source of embarrassment if they get left in modules and get distributed to users.

The only good reason why one would want to use Stop would be if you had to test for something where break mode wasn't available or involved shutdown/restart/open, but even so, it's more hassle than helpful.

If you leave in breakpoints and forgot about it, it get cleared away when you shut the application, and thus no embarrassment (unless you have that phantom breakpoint as Pat described, of course)
 

Users who are viewing this thread

Back
Top Bottom