Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Aug 2001
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Planning help requested (Access XP)

    I'm in the planning phase of a new database. This db will track documents submitted to the db. One of the requirements that I'm chewing on is that each user should only be able to see documents that they submitted themselves.
    I was planning applying security so that each user has to log on to the database, and then I'm hoping that I could use a filtered form that would limit the display of documents to the individual who is logged on.
    1) Is this possible?
    2) Is there a better method of limiting viewing access?

    Thanks in advance!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Planning help requested (Access XP)

    CurrentUser is the name under which the user is logged in. In an unsecured database, this is always Admin, but in a secured database, it is the actual login name. You could add a UserName field to the documents table, set this field in the BeforeInsert event of the form bound to the table:

    Private Sub Form_BeforeInsert(Cancel As Integer)
    Me.UserName = CurrentUser
    End Sub

    You could create a query that selects all fields from the table, with CurrentUser() as criteria for the UserName field. This query will only return records entered by the current user. You can use this query as record source for forms and reports.

    Of course, you must not allow standard users to view or edit tables and queries directly.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    632
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Planning help requested (Access XP)

    (Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>)

    In addition to Hans' information, you can use Read With Owners Permission queries to deny the users permission to read the tables, which forces them to use the queries that include the CurrentUser function. You may want to check out my paper at http://www.geocities.com/jacksonmacd
    --------------------------------------------------
    Jack MacDonald
    Vancouver, Canada

  4. #4
    2 Star Lounger
    Join Date
    Aug 2001
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Planning help requested (Access XP)

    Thanks guys - I'm adding this thread to my reminder list. And yes I've printed out your security paper, I found it quite helpful. I'll have to go through it again tho'.

    Cheers

Posting Permissions

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