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

Access Security - Using the User value 2

Status
Not open for further replies.

SABS

Programmer
Nov 21, 2003
14
CA
In reading various threads, it sounds like the general concensus is that the Access security is the way to go in order to safely secure a database.

Is it possible to determine/use the logged in user and use that value in code to, for example, load a listbox with items relevant to that user based on values in a table? If so, how?
 
The current Access User is returned by currentuser()

You can then set a value in a textbox to the currentuser (perhaps even the default value) and hide it. Then reference that control in your query as criteria.
 
Another similar approach that I use is to create a function that simply returns the currentuser value. Access won't let you use the currentuser value as a criteria, but it lets me use my function as a criteria. This is easier for me because I don't have to customize the queries to each individual form.
 
Thanks, both of you.

A step further - can you determine which Group the user belongs to programmatically?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top