Step through code

S

Stephanie

Hi. I posted earlier about a loop I can't seem to get
through. There is chance to debug (no error type, just
an Access msg box).
How can I step through my code to see where I am, so I
can see the values assigned and maybe determine why I'm
not making it all the way through. Arg!! I realize as a
newbie I write terrible code, but this is the last big
thing I need to fix. Thanks, Stephanie
 
R

Rob Oldfield

Select the line you want to break on, then Debug, Toggle Breakpoint (or F8).

It'll stop at that line... then continue stepping through with F8.... or
continue to the next breakpoint with F5.

When you're doing that, then the immediate window (which lets you evaluate
expressions given the current context) and the locals window (both from the
view menu) are your friends.
 
C

ChadNick

Rob's answer is good, but just as a note, if using a recent version (5 or 6
upwards methinks), if you click to the side of your code, in the long gray
box, a red circle will appear, and the line itself will turn a deep red. This
means that a 'breakpoint' has been set.
Once your code reachs this point, it will stop, and bring you to your code
window. The program will freeze in the background, and as a simple way of
checking variables, holding your cursor over any variable name will show its
value. This is useful, to see where your code is going wrong (for example, if
something contains a null value where it shouldn't).

You can then re-start your code by pressing the 'Play' (Blue triangle)
Button near the top of your screen. And as an alternative to
step-by-stepping, you can simply set multiple breakpoints, and quickly run
through the points where you think things are going wrong.

Hope that helps!
 

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