Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Public Variable

Status
Not open for further replies.

jtseltmann

Programmer
Jan 15, 2002
149
US
Just a quick question...trying to understand why someone used "global" instead of "public" to declare a public var...

I have a var declared as public in a standard module/declarations section...that means this variable should be visible throughout all modules (even a form's module) correct? I just want to be sure I can reference it from any sub/function or event etc.

I did a quick search and it seems global is an older term. Wondering if I can replace that with Public without causing problems. I want to be sure global wasn't used for a reason..and I couldn't find one.

Thanks!
 
Global has exactly the same meaning as Public in the Dim instruction.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you PHV...that is the confirmation i was looking for.

 
Just a bit of history on Global vs Public -

Global is a carryover from Access 97 and previous versions before Access 2000 underwent change and became based on VB6 which used the newer PUBLIC keyword instead of the GLOBAL keyword.



Bob Larson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top