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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Public variables in database with multiple users 1

Status
Not open for further replies.

clapper62

Programmer
Apr 17, 2003
113
US
I have an Access database with multiple users which has public variables declared in a module. My question is if 1 user on 1 workstation changes the value of the variable is that value changed for any other users on different workstations?

"There is no pleasure in having nothing to do; the fun is having lots to do and not doing it.
." - Andrew Jackson
 
No.

All variables are scoped to the application instance, in this case on each machine. Even two separate instances on the same machine could have different variable values.

The same is true for it but you might look at the new Tempvars collection to store variables as those values perist even when cases where traditional variables are wiped (certain crashes).

The only data common among multiple instances is table data.
 
To keep out of trouble with Globals just make sure you structure them around a private variable declared in module they reside in, for example

Option Explicit
Private sCatNo as string


Public Function SetCatalogNo(byval passStr as String)

sCatNo=passStr

End Function

Public Function GetCatalogNo() as String

GetCatalogNo=sCatNo

End Function


It will also make it easier to organize them into classes later if you decide to do so.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top