G
Gary Schuldt
I haven't (successfully) used global variables yet, so I have a couple of
questions. The general context here is a multi-user environment with user
profiles (quite rudimentary at this point in the development).
1. Declaring
I assume I at least declare Public pubVar As . . . outside of any particular
module in a Modules object (container).
Q1: Do I also declare it using the same syntax in every module in which I
want to refer to it?
2. Profile parameters
I have a few users already. I'd like to put their profile parameters
(fields) into a tblUsers.
When a user logs on, I could store their UserID in a Public pubIntUserID.
Then, whenever I wanted to use a particular User.field value, I could look
it up in the tblUsers.
Or, I could copy ALL the parameters for that UserID into Public variables
and use them that way in the modules that need them.
Q2: Any comments on which is preferable from a best practice point of view?
Q3: Any other things to watch out for in this approach?
Thanks in advance.
Gary
questions. The general context here is a multi-user environment with user
profiles (quite rudimentary at this point in the development).
1. Declaring
I assume I at least declare Public pubVar As . . . outside of any particular
module in a Modules object (container).
Q1: Do I also declare it using the same syntax in every module in which I
want to refer to it?
2. Profile parameters
I have a few users already. I'd like to put their profile parameters
(fields) into a tblUsers.
When a user logs on, I could store their UserID in a Public pubIntUserID.
Then, whenever I wanted to use a particular User.field value, I could look
it up in the tblUsers.
Or, I could copy ALL the parameters for that UserID into Public variables
and use them that way in the modules that need them.
Q2: Any comments on which is preferable from a best practice point of view?
Q3: Any other things to watch out for in this approach?
Thanks in advance.
Gary