Multi-Users database filter question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jaad
    New Member
    • Oct 2009
    • 158

    Multi-Users database filter question

    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?
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    When you want the current user that's logged in into Windows, you can use the Environ() function like:
    Code:
    Me.CurrentUser = Environ("Username")
    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)

    Comment

    Working...