You have to decide on a naming convention so that global variables are not
confused with those scoped to only one sub or function.Adopting a naming
convention will make coding much easier for you.
Also, I suggest using names more descriptive than VAR1. Names like
gvarLastName indicates a global variant variable for Last Names.
gstrLastName indicats a string variable.
If the "global" variable is really scoped to only a form o rreport, I use p
instead of g. The p stands for private indicating it is scoped to just the
object in which it is declared.
--
Bill Mosca, MS Access MVP
http://tech.groups.yahoo.com/group/M..._Professionals
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> i have declared one global varibale named VAR1 in form module and
> another defined in sub proecdure with the same name (VAR1) in the same
> form module . if i use VAR1 then local variable will be
> accessed .......but if i wanna use the global variable explicitely in
> the same procedure then how i we do that.........
>
> Please let me know as i am new to VBA.
> Thanks in advance.
>
> Vikram
>