can't debug form code

M

Mark

I have a front end access 2000 project that I am trying to debug.
For some reason , I put in breakpoints and the the debugger does NOT break
on the breakpoints.

I don't know a whole lot about Access, is there someway the front end has
been disabled from being debugged?? If so, how would I get around this so I
can debug the
code in the forms?

Thanks, Mark
 
A

Alvin

The first place I would check is to make user the
breakpoints have been placed on code that you are certain
will be executed.

Add a breakpoint to the form's On Open event. If it has
none, create it. You can be 99% certain that the On Open
event for a form will fire; other events are conditional
and if you're not certain about process flow, you could
simply be breakpointing the wrong place.

It doesn't hurt to verify the simple things first.
 
R

Ronald Dodge

Are you sure that line of code, the break point is on, is being attempted to
execute? If so, it should break regardless without this particular line of
code being executed. I'm assuming you are working in the MDB file, not a
MDE file, as with MDE, you have no access to the source code itself.

Example:

If X = Y Then
<Do This>
Else
<Do That>
End If

If you have the break point set to the line that has "<Do This>", and "X" is
not equal to "Y", then the code will not stop as that line of code won't get
executed due to the false condition that it will return in that case.

If however, you put the breakpoint on the line "If X = Y Then" and the code
is about to execute this line of code, it should break at this line just
before actually executing the line, thus should give you a change to go into
VBA and debug without this particular line of code being executed.

One other thing that can be done, you could put in the key word, "Stop", as
this will cause the code to break at that particular line, should it be
executed, but I don't like doing it this way cause it's too easy to miss
when cleaning up the code afterwards. It's much easier for the eye to spot
a highlighted break point line then to see a key word, "Stop", cause after
looking over so many hundreds (if not thousands) of lines of code, the code
may not be as much paid attention to.

I not only use VBA's debugging tools, but I have also developed my own
debugging methodology as there are times when using VBA's debugging tools
themselves isn't enough to debug an issue. One such way that I debug, I use
labels on forms, and then have the code report into those labels some
information to help guide me where the issue might be. I usually resort
more so to this sort of debugging in more complex situations.
 
M

markus

Actually, all I had to do was open the .mdb file holding the "Shift" key
down and everything started working.
I got my menu items and the debugger started working.

thanks.
 
B

Bruce M. Thompson

I have a front end access 2000 project that I am trying to debug.
For some reason , I put in breakpoints and the the debugger does NOT break
on the breakpoints.

I don't know a whole lot about Access, is there someway the front end has
been disabled from being debugged?? If so, how would I get around this so I
can debug the
code in the forms?

Go to "Tools, Startup..." and, in the resulting dialog, click on the "Advanced
 

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