Perhaps someone else can suggest a tool, but hope this experience helps.
When I first started coding, I used to print out the code and draw lines to
match the block operations such as If...EndIf, or For...Next. Haven't done
that for years now. FWIW, here's my current approach.
1. Indent
You probably do this. Indenting every block operation is the simplest way to
help keep them matched.
2. Modularize
Break the code down into smaller procedures. Ideally, a procedure should be
no more than a couple of screenfuls. Helps avoid huge numbers of embedded
indents.
3. Outside in
Type the End If immediately after the If. Your code is therefore coming up
from the bottom as well as down from the top. If you are not doing this, it
will probably solve the issue for you.
For example, you type:
If x < 0 Then {Enter} End If {Up} {End} {Enter} {Tab}
and you are then ready to code the inner part of the If block.
4. Rotate your monitor
Why code on a landscape monitor, when it would be so much easier to stay on
top of the blocks with portrait orientation?
A couple of years ago I did move to dual monitor: application on the left
(normal landscape) and code on the right. It was then obvious that the right
monitor needed to be portrait, so I flipped the old 19" CRT on its side and
told the nVidia driver to rotate the image.
This suggestion won't suit everyone, but the flippin' code monitor is the
best hardware change I have made in the last few years. And the combination
of these 4 approaches means I never get lost any longer with block
operations.
HTH.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"MLH" <CR**@NorthState.net> wrote in message
news:n7********************************@4ax.com...
Would love to be able to click on any If-statement
and launch a utility that would find what A97 believes
to be its corresponding EndIf. Such a tool would save
me lots of time as I am forever botching them up and
having to go back 'n fix 'em.