Considering the set up:
- Ms Access Application split into Front End and Back End = both native MS Access
- Front End consists of forms only – it will be the only way to access data
- Front End copy distributed to each user machine (thanks for answers to this question)
I need to implement the following scenario:
- Ms Access application with < 20 users,
- each user is assigned to 1 to 10 projects,
- when user opens the MS Access he should only be presented with the data related to the project(s) he is assigned to
So for example we have users:
- John
- Owen
John is assigned to projects A,B,D.
Owen to B,DWhen John logs in he can see only data
related to projects A,B,D. When Owen
logs in he can see only B,DJohn and Owen can access the application at the same time
Related tables in the Back End
- user
- project
- userProject – links user(s) to project(s) in many to many relationship.Each user can be assigned to one or more projects, one or more users can work on a project.
I came across this solution on databasedev.co.uk which basically uses a hidden form to store the current users details and then using this to filter the data on other forms.
So here is my Question:
Would that be the recommended solution? Are there any better options? I was thinking that I could use a table on the Front End instead of the hidden form for example.
Edit Re Comment
I see no reason why you should not maintain a table of users in the back-end with a join table of user, project that can be used to filter the projects.
The current user can be obtained with code if you are using network name (http://www.mvps.org/access/api/api0008.htm), it can be stored to a hidden field on the form, which would be useful for setting the form to relevant projects, or you could store the name to a custom database property (http://wiki.lessthandot.com/index.php/Custom_Database_Properties_Creation_and_Use)
The code below applies to finding number of logged-in users.
You could use provider specific ADO Schemas. You need to pass a valid connection, for example:
More information: http://msdn.microsoft.com/en-us/library/aa155436.aspx