Situation:
I have a database that has users with different levels of access to the information they are allowed to view. I have addressed this issue by creating a login form that opens on startup. Behind this form is the tblUserDetails, which has login information such as: userID, password and access level (which has three levels: basic/full/admin).
Problem:
Once the user has logged in I would like to be able to retrieve their userID and access level (AccLvl) for the entire time they are using the database (ie that session). That is, controls of forms are made visible/hidden and enabled/disabled depending on the users access. Currently I am handling this by passing the userID and AccLvl values from one form to the next. In other words, I have two hidden controls on every form (txtuserID and txtAccLvl) and I populate these controls every time I open a new form. I feel this system could be improved.
Question:
Is there a way to store the userID and AccLvl information as a VBA variable? I have not used VBA to store global-sessional information like this before and I am not sure how it would work in my current multi-user networked environment (see below). Any advice would be greatly appreciated.
System Environment:
- I’m using Access 2000.
- The database is located on a network.
- It is expected that there could be up to 5 users at any one time.
- The database is split with both the front end and back end on the network. The main users of the database have copies of the front end set up on their local desktops that link to the networked back ends. However, it is possible (but not common) that more than one user at a time might access the front end which is located on the network.
I have a database that has users with different levels of access to the information they are allowed to view. I have addressed this issue by creating a login form that opens on startup. Behind this form is the tblUserDetails, which has login information such as: userID, password and access level (which has three levels: basic/full/admin).
Problem:
Once the user has logged in I would like to be able to retrieve their userID and access level (AccLvl) for the entire time they are using the database (ie that session). That is, controls of forms are made visible/hidden and enabled/disabled depending on the users access. Currently I am handling this by passing the userID and AccLvl values from one form to the next. In other words, I have two hidden controls on every form (txtuserID and txtAccLvl) and I populate these controls every time I open a new form. I feel this system could be improved.
Question:
Is there a way to store the userID and AccLvl information as a VBA variable? I have not used VBA to store global-sessional information like this before and I am not sure how it would work in my current multi-user networked environment (see below). Any advice would be greatly appreciated.
System Environment:
- I’m using Access 2000.
- The database is located on a network.
- It is expected that there could be up to 5 users at any one time.
- The database is split with both the front end and back end on the network. The main users of the database have copies of the front end set up on their local desktops that link to the networked back ends. However, it is possible (but not common) that more than one user at a time might access the front end which is located on the network.
Comment