Unanswered: Restrict access to query/form design by windows login
ETA: This DB is in Access 2003.
I've been trying to setup my Splash/Welcome screen in my Access DB. So far, I've been able to launch different forms depending on the UserLevel I've given to different users. This is my code so far:
Private Sub Form_Open(Cancel As Integer)
If DLookup("UserLevelID", "Agents", "Windows_Login='" & GetUser() & "'") = 3
Then DoCmd.OpenForm "Call log", acFormDS
If DLookup("UserLevelID", "Agents", "Windows_Login='" & GetUser() & "'") < 3
Then DoCmd.OpenForm "ControlPanel"
MsgBox "You do not have the authorization to use this file!", vbCritical, "Error"
I did import pkstormy's code for "GetUser" and "SystemInfo" and it does help a lot. I'm pretty sure that what I want to do is feasible, probably even not that advanced, but I'm blocked at this point. Doing the above is so over my skill level that I'm feeling my way here.
So. Now, I'd like to set permissions as follows:
- People with UserLevelID = 1 : Data: All access. Design: have all access to create, modify and delete all the stuff in the DB.
- People with UserLevelID = 2 : Data: All access to read, write, update, delete. Design: have the possibility to create and modify queries for their own reporting purposes
- People with UserLevelID = 3 : Data: Add and modify data in a single table, through the "Call log" form only. Design: no access.
- All others: "You do not have the authorization to use this file!"
Thanks in advance!
Last edited by ZahraB; 07-25-12 at 08:55.
Reason: Reading "Read before asking" = add more details :P