tags:

views:

246

answers:

1

When I'm coding VBA in Access 2003, I keep the Immediate window visible and I use Debug.Print and Stop to solve my challenges. But I've never known how to get help from the "Locals" window. I understand what's in there for the most part. But it usually seems like I'd have to dig around for the item I want, and it could take a while to find it in all those folded structures.

(And "Locals" doesn't bring up anything from the built-in VBA help files. Maybe I'm missing a file ...)

I bet I could start using Locals, if I knew what it's good for in a practical way. Do do you have an explanation or anecdote that would clue me in?

+4  A: 

Locals provides a couple of benefits: You can F8 through the code and watch how a variable changes by looking at the locals window as opposed to issuing debug.print statements or hovering over the variables. You can see the contents of an array a heck of a lot quicker than issuing lbound and ubound and a bunch of other statements to check values. Not just arrays either, but any complex data structure such as a custom class module.

Dick Kusleika
I recently learned to keep an eye on the "Variables" window when using NetBeans/XDebug for PHP. Your answer is telling me VBA "Locals" is the simple equivalent. That's definitely the handle I was looking for.
Smandoli
A week later: I am reaching for Locals naturally. Thanks again.
Smandoli