By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,012 Members | 988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,012 IT Pros & Developers. It's quick & easy.

"Global" Qualifier question

P: n/a
Lyn
Hi and Season's Greetings to all.

I have a question regarding the use of a qualifier word "Global". I cannot
find any reference to this in Access help, nor in books or on the Internet.
"Global" seems to be recognised by Access in at least three cases:-

1) "Global Const". Recently someone in this group helped me resolve a
problem, and it involved the use of a Global Const. By Googling "Global
Const", I got plenty of hits -- but they were mostly just snippets of code
using this type of statement. Is there any difference between "Global
Const" and "Public Const"? If so, what is it?

2) "Global" variable. In an experiment, I found that I could replace "Dim"
(or "Public" or "Private") with "Global" in a variable declaration and it
would be accepted by Access VBA. Example -- instead of "Public x As
Integer" I typed "Global x As Integer". Again, is there any difference
between "Public" and "Global" in the variables context?

3) "Global Sub/Function". In another experiment, I entered into a module:
"Global Sub xxx()" and pressed ENTER. The compiler accepted this, but
automatically deleted "Global", leaving just "Sub xxx()". However, if I
replaced "Global" with some arbitrary "word" (eg: "Qaz Sub xxx()"), I got a
compiler error. So it seems that the compiler accepts "Global Sub" but
treats it like a "Public Sub" (which just "Sub" defaults to).

So my question is: what is it with "Global"? My guess would be that it is
an obsolescent form that is still supported for backwards compatibility.
This could explain why it is not documented anywhere that I could find. If
so, is it fully equivalent with "Public". If not, what exactly does
"Global" mean, and where can I find any documentation?

I am sure the gurus out there will know the answer to this!

--
Cheers,
Lyn.
Nov 13 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On Fri, 24 Dec 2004 15:40:30 +1100, "Lyn" <lh******@ihug.com.au>
wrote:
Hi and Season's Greetings to all.
[...]
So my question is: what is it with "Global"? My guess would be that it is
an obsolescent form that is still supported for backwards compatibility.
This could explain why it is not documented anywhere that I could find. If
so, is it fully equivalent with "Public". If not, what exactly does
"Global" mean, and where can I find any documentation?


"Global" is indeed an obsolete keyword stemming from Access 2.0 and
earlier. You can replace any occurrence of "Global" with "Public"; the
two keywords mean exactly the same.

HTH
Matthias Kläy
--
www.kcc.ch
Nov 13 '05 #2

P: n/a
Lyn
Thanks Matthias. You have confirmed my suspicions.

--
Cheers,
Lyn.

"Matthias Klaey" <mp**@hotmail.com> wrote in message
news:hg********************************@4ax.com...
On Fri, 24 Dec 2004 15:40:30 +1100, "Lyn" <lh******@ihug.com.au>
wrote:
Hi and Season's Greetings to all.

[...]

So my question is: what is it with "Global"? My guess would be that it is
an obsolescent form that is still supported for backwards compatibility.
This could explain why it is not documented anywhere that I could find.
If
so, is it fully equivalent with "Public". If not, what exactly does
"Global" mean, and where can I find any documentation?


"Global" is indeed an obsolete keyword stemming from Access 2.0 and
earlier. You can replace any occurrence of "Global" with "Public"; the
two keywords mean exactly the same.

HTH
Matthias Kläy
--
www.kcc.ch

Nov 13 '05 #3

P: n/a

"Lyn" <lh******@ihug.com.au> wrote in message
news:cq**********@lust.ihug.co.nz...
Hi and Season's Greetings to all.

I have a question regarding the use of a qualifier word "Global". I
cannot find any reference to this in Access help, nor in books or on the
Internet. "Global" seems to be recognised by Access in at least three
cases:-

1) "Global Const". Recently someone in this group helped me resolve a
problem, and it involved the use of a Global Const. By Googling "Global
Const", I got plenty of hits -- but they were mostly just snippets of code
using this type of statement. Is there any difference between "Global
Const" and "Public Const"? If so, what is it?

2) "Global" variable. In an experiment, I found that I could replace
"Dim" (or "Public" or "Private") with "Global" in a variable declaration
and it would be accepted by Access VBA. Example -- instead of "Public x
As Integer" I typed "Global x As Integer". Again, is there any difference
between "Public" and "Global" in the variables context?

3) "Global Sub/Function". In another experiment, I entered into a module:
"Global Sub xxx()" and pressed ENTER. The compiler accepted this, but
automatically deleted "Global", leaving just "Sub xxx()". However, if I
replaced "Global" with some arbitrary "word" (eg: "Qaz Sub xxx()"), I got
a compiler error. So it seems that the compiler accepts "Global Sub" but
treats it like a "Public Sub" (which just "Sub" defaults to).

So my question is: what is it with "Global"? My guess would be that it is
an obsolescent form that is still supported for backwards compatibility.
This could explain why it is not documented anywhere that I could find.
If so, is it fully equivalent with "Public". If not, what exactly does
"Global" mean, and where can I find any documentation?

I am sure the gurus out there will know the answer to this!

--
Cheers,
Lyn.


global is globe like. public is just public. no documentation needed yes?

***Sherwood Wang MVP***

Nov 13 '05 #4

P: n/a
Lyn
I'm sorry, I didn't understand your comment. I know what "global" means in
English, and in computer-speak it usually means something like "valid
everywhere". But then isn't that also what "public" means in the VBA
context? Hence Matthias' comment that both mean the same thing.

I wasn't using Access in its early version, so I am assuming from Matthias'
comment that "Public" has replaced "Global", or perhaps that the two terms
were so close in function that they were merged, possibly to avoid confusion
(like mine :-).

--
Cheers,
Lyn.

"Sherwood Wang" <sh****@waynesworld.net> wrote in message
news:1103873112.a49a4b10d0f142d9086e9db99e2966fb@t eranews...

"Lyn" <lh******@ihug.com.au> wrote in message
news:cq**********@lust.ihug.co.nz...
Hi and Season's Greetings to all.

I have a question regarding the use of a qualifier word "Global". I
cannot find any reference to this in Access help, nor in books or on the
Internet. "Global" seems to be recognised by Access in at least three
cases:-

1) "Global Const". Recently someone in this group helped me resolve a
problem, and it involved the use of a Global Const. By Googling "Global
Const", I got plenty of hits -- but they were mostly just snippets of
code using this type of statement. Is there any difference between
"Global Const" and "Public Const"? If so, what is it?

2) "Global" variable. In an experiment, I found that I could replace
"Dim" (or "Public" or "Private") with "Global" in a variable declaration
and it would be accepted by Access VBA. Example -- instead of "Public x
As Integer" I typed "Global x As Integer". Again, is there any
difference between "Public" and "Global" in the variables context?

3) "Global Sub/Function". In another experiment, I entered into a
module:
"Global Sub xxx()" and pressed ENTER. The compiler accepted this, but
automatically deleted "Global", leaving just "Sub xxx()". However, if I
replaced "Global" with some arbitrary "word" (eg: "Qaz Sub xxx()"), I got
a compiler error. So it seems that the compiler accepts "Global Sub" but
treats it like a "Public Sub" (which just "Sub" defaults to).

So my question is: what is it with "Global"? My guess would be that it
is an obsolescent form that is still supported for backwards
compatibility. This could explain why it is not documented anywhere that
I could find. If so, is it fully equivalent with "Public". If not, what
exactly does "Global" mean, and where can I find any documentation?

I am sure the gurus out there will know the answer to this!

--
Cheers,
Lyn.


global is globe like. public is just public. no documentation needed
yes?

***Sherwood Wang MVP***

Nov 13 '05 #5

P: n/a
Lyn, Sherwood Wang is known for trolling.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #6

P: n/a
Lyn
Fair enough!

--
Cheers,
Lyn.

"Bas Cost Budde" <b.*********@heuvelqop.nl> wrote in message
news:cq**********@news2.solcon.nl...
Lyn, Sherwood Wang is known for trolling.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea

Nov 13 '05 #7

P: n/a
On Fri, 24 Dec 2004 12:39:03 +0100, Bas Cost Budde <b.*********@heuvelqop.nl>
wrote:
Lyn, Sherwood Wang is known for trolling.


Actually, a sock puppet under the name of Sherwood Wang.
Nov 13 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.