How do variables work?

  • Thread starter Thread starter Alejandro
  • Start date Start date
A

Alejandro

Hello there,

I have a form in which code I've declared 5 variables as integers, all to be
used as counters which trigger certain actions in the form. The form will be
used by several people simultaneously. Will a have a problem with the
counters of one user being triggered by other users, or does each opened
instance create a copy of its own variables?

Thanks in advance,

A.
 
Hi Alejandro,

You will not have a trouble. Each person's instance creates the
variables locally on their own computers. In fact, if you were to open two
instances of the database on your own computer, they would not interfere with
each other because they are local to each instance.

Clifford Bass
 
Thanks Cliff!

Clifford Bass said:
Hi Alejandro,

You will not have a trouble. Each person's instance creates the
variables locally on their own computers. In fact, if you were to open two
instances of the database on your own computer, they would not interfere with
each other because they are local to each instance.

Clifford Bass
 
Cliff's given you the correct answer, but I thought I'd chime in because
typically people don't worry about this unless all users are using the same
database.

If that's the situation you have, you should correct it. All applications
should be split into a front-end (containing the queries, forms, reports,
macros and modules) linked to a back-end (containing the tables and
relations). Only the back-end should be on the server. Each user should have
his/her own copy of the front-end, preferably on his/her hard drive.
 
Hi Douglas,

Variables, global, modular-level, subroutine-local, that are created in
code are always local to the instance of Access that is being run, regardless
of how many people are connected to the database. Now, if he starts storing
the information in a table, that is another issue. And your information
would definitely apply. Additionally, to keep the information local, a table
in the front end would be appropriate.

Regardless of all that, since he is dealing with multiple users,
splitting is definitely recommended.

Clifford Bass
 
Back
Top