user level security

  • Thread starter andy stanford-jason
  • Start date
A

andy stanford-jason

i have built a database with my own menu to navigate it. on the menu is a
combobox to select who you are. once you have picked who you are how can that
be used through out the program, ie. id like to use it as you would use
current user. so when making a new record i could store the current user in
one of the fields so i would know who made it. thanks
 
A

Ann in CA

In one of the modules of your database declare something as a global
variable, i.e.,
global glUsername as string
In the afterupdate procedure of the combo box, you could set glUsername =
me.combobox
then anywhere you want to use the username, you would reference glUsername
 
A

andy stanford-jason

thanks, one oter question: where do you declare global variables? thanks
 
A

Ann in CA

In your database window, the bottom row under objects is called modules.
Create a new module.
Under

Option Compare Database
Option Explicit

is where you would type " global glUsername as string"
Then save the module (name really isn't important, as you won't refer to it
anywhere, you could call it modBasic)
 
Top