Results 1 to 1 of 1
  1. #1
    Join Date
    Jul 2012
    Posts
    8

    Unanswered: Restrict access to query/form design by windows login

    ETA: This DB is in Access 2003.

    Hello,

    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:

    Code:
    Private Sub Form_Open(Cancel As Integer)
    DoCmd.Maximize
    If DLookup("UserLevelID", "Agents", "Windows_Login='" & GetUser() & "'") = 3 
    Then DoCmd.OpenForm "Call log", acFormDS
    Else 
    If DLookup("UserLevelID", "Agents", "Windows_Login='" & GetUser() & "'") < 3 
    Then DoCmd.OpenForm "ControlPanel"
    Else 
    MsgBox "You do not have the authorization to use this file!", vbCritical, "Error"
    End Sub
    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!"

    Some help?

    Thanks in advance!
    Last edited by ZahraB; 07-25-12 at 09:55. Reason: Reading "Read before asking" = add more details :P

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •