By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,374 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Multi-Users database filter question

100+
P: 158
I am setting up a multi-users database. The login procedure creates a temporary variable called[TempVars]![CurrentUserID] which I use throughout the database to filter data the user sees only the data that relates to his or her activities on the database.

I havenít tested if this method work while having more than one user logged-in yet. I know it works fine if I login under a different UserID. The test files that I created prove the CurrentUserID concept. Being that I am just a newbee I wanted to ask if there was something I should be aware of while utilizing this method of filtering forms?

Also, Iíve Created a table that I call [Colaborate] which [CurrentUserID] can open to click on an Employee or Supplier or contact to work conjointly on a project that was created under a certain [CurrentUserID]. I want to make the user that was chosen by the currentuserID to be able to see files that was relating only to the currentuserID and was thinking of using an add-on to the queries . At the moment it is very simple: most of my forms have a query for control source with a simple criteria =[TempVars]![CurrentUserID]Ö I was wondering if I could add the ID Field of another employee by using ďORĒ or ďANDĒ after =[TempVars]![CurrentUserID]Ö OR [ColaborateT].[EmployeeID]
Iíve tried a few variation so far and I havenít produced anything that looks promising except a blank sheet with no result after I run the query. How can I do this?
Feb 11 '10 #1

✓ answered by nico5038

When you want the current user that's logged in into Windows, you can use the Environ() function like:
Expand|Select|Wrap|Line Numbers
  1. Me.CurrentUser = Environ("Username")
  2.  
Thus you're always sure that it's the (Windows) logged in user. This can also be used in your table to fill the creator of a row and to filter rows to show.

Nic;o)

Share this Question
Share on Google+
1 Reply


nico5038
Expert 2.5K+
P: 3,072
When you want the current user that's logged in into Windows, you can use the Environ() function like:
Expand|Select|Wrap|Line Numbers
  1. Me.CurrentUser = Environ("Username")
  2.  
Thus you're always sure that it's the (Windows) logged in user. This can also be used in your table to fill the creator of a row and to filter rows to show.

Nic;o)
Feb 14 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.