Results 1 to 4 of 4

Thread: Access Security

  1. #1
    Join Date
    Nov 2004
    Posts
    51

    Question Unanswered: Access Security

    I am trying to set up user-level security for an access db and am wanting to restict some of the controls. Am I correct that this is no easy task in Access?
    How might I go about doing this?

    Thanks for everyone's Help!!

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    What I did is In the Tab part of the propertie or each feild in a form I put
    one of 3 values
    user,Manager,Admin

    user can only see user stuff
    manager can only see user,manager stuff
    and
    admin can see all

    also had Hide just don't show it.

    in the Timer event of each form

    had have a login screen

    base on that login if would
    set some

    Global Who As String
    Global isadmin As Boolean




    Code:
    Private Sub Form_timer()
    Call Form_Current
    Call EDITIT
    DoCmd.GoToControl "id"
     Me.TimerInterval = 0
    End Sub
    I wrote this Editit Sub

    which would loop all controls on a form and make then Visible or not
    Code:
    Sub EDITIT()
    Dim frm As Form, ctl As Control
    Dim whoo As String
      Set ctl = Screen.ActiveControl
          If Me.SHOW_SCREEN.Visible = True Then
    '         Me.SHOW_SCREEN
    whoo = Who
    If whoo = "Personnel Assistants" Then whoo = "Manager"
        If isadmin Then
        Me.ShortcutMenuBar = ""
        Else
        Me.ShortcutMenuBar = "=1"
        End If
            For Each ctl In Me.[SHOW_SCREEN].Controls
           If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Or ctl.ControlType = acCommandButton Then
                If ctl.Tag = whoo Then
                  ctl.Visible = True
                Else
                '  ctl.Visible = False
                End If
                If IsNull(ctl.Tag) Or Len(ctl.Tag) < 1 Then ctl.Visible = True
                If Who = "Admin" Then
                    ctl.Visible = True
                Else
                
                End If
                If ctl.Tag = "Hide" Then ctl.Visible = False
                Else
                End If
        Next ctl
    '      Me.AllowFilters.AllowFilters = isadmin
    Else
    End If
    Me.SHOW_SCREEN.LinkMasterFields = ""
    Me.SHOW_SCREEN.LinkChildFields = ""
    Me.SHOW_SCREEN.LinkMasterFields = "Event ID"
    Me.SHOW_SCREEN.LinkChildFields = "Event ID"
    Me.AllowEdits = isadmin
    Me.Recalc
    End Sub
    Last edited by myle; 09-27-05 at 19:48.
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Nov 2004
    Posts
    51
    Thanks for the insight. I might be able to do something like that with the locked property.

  4. #4
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    Good point never tought of that
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

Posting Permissions

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