Read Access & Read & Write Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nicolenwn
    New Member
    • Nov 2009
    • 23

    Read Access & Read & Write Access

    Hi, i have another question regarding MS Access database again):

    Hope i could get some help and advise! It'll be greatly appreciated.

    As i have a database of records. This databse is used by 2 different teams.

    My team needs Read and Write Access while another team can only be granted Read Only Access.

    Is there any way i can create a Read Only Access only and grant it to the other team?

    Best wishes and many thanks for the help!
    Cheers,
    Nicole((:
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    Adv. solution is to setup Security on the database, whcih can be troublesome to setup and to maintain.

    The quick solution:

    You could add some simple code in the form's open event.

    Code:
    Private Sub Form_Open(Cancel As Integer)
        'Check for user in table of "approved users"
        If Not IsNull(DLookup("KEY_User", "tbl_ApprovedUsers", "tx_UserName='" & Environ("UserName") & "'")) Then
            Me.AllowAdditions = True
            Me.AllowEdits = True
            Me.AllowDeletions = True
        Else
            Me.AllowAdditions = False
            Me.AllowEdits = False
            Me.AllowDeletions = False
        End If
    End Sub
    All you need to do is to create a tbl_ApprovedUse rs and add the windows username of each user you want to have write access. The Environ("UserNa me") will return the windows username for you.

    Comment

    Working...