Static Variables

ions

Access User
Local time
Today, 15:11
Joined
May 23, 2004
Messages
875
Dear Access Expert.

If I a declare a variable "Static" in a Sub procedure, is this variable shared among multiple users or does each user create a seperate static variable on their machine that can only be updated by that user.

What about global module variables are they shared among multiple users or does each user have his/her own copy?


Thanks A lot
 
A variable declared in a subroutine is Private to that routine.
In a module -
Dim - works at Project level
Public - works at Application level

The Static keyword operates only within the procedure that contains it.
 
ions, to answer your question ;)

When you use a variable - whether it be Public (Global), Private, or Static - in Access, it only relates to the instance/session of Access running on the machine.

So, you can't open Access on two computers and expect the variables to pass between them.

Should you wish to pass values between different users then create a table with the values you want and change (and refer to) these using DAO or ADO.
 
Thanks

Thanks Mile-O-pile

That helped alot.

Peter
 

Users who are viewing this thread

Back
Top Bottom