user level security

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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)
 
Back
Top