Variable Scope

D

Don

I need a variable available to several procedures in a report, but not
visible to the rest of the world. Do I just put:


Private MyVariable as Integer

at the top of the code (same level as the procedures)? Or do I use the
"Public" qualifier? But wouldn't that make it visible across all the
modules?

Thanks!


Don
 
R

Rick Brandt

Don said:
I need a variable available to several procedures in a report, but not
visible to the rest of the world. Do I just put:


Private MyVariable as Integer

at the top of the code (same level as the procedures)? Or do I use
the "Public" qualifier? But wouldn't that make it visible across all
the modules?

In the top of the Report module (no "Public")
 
P

Paul Overway

Using Private at the top of the report module will make the variable
available within the module. Using Public would make it available from
anywhere, if the report is open. So, you'd be correct to use Private.
 

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