Results 1 to 14 of 14
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Only allowing file attachments (2002)

    Is it possible when securing a database to allow members of the Users Group to ONLY add file attachments?? Thanks, Andy.

  2. #2
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Only allowing file attachments (2002)

    Can you elaborate on the question. I don't quite understand what you are trying to do?
    Regards,
    Rudi

  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Only allowing file attachments (2002)

    Three staff use the database to add/ edit/ delete records, etc. However, other staff should be able to view the records, but in addition to insert a Word document to OLE Object fields. Does this make a little more sense? Andy.

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

    Re: Only allowing file attachments (2002)

    I wouldn't insert Word documents in OLE fields, but store the path to the documents in a text field or hyperliink field. Whichever method you choose, Access security does not operate at the level of individual fields; it operates at the level of database objects. You should handle it in the form(s) used to view and edit the data. You can lock/unlock a control based on the username.

  5. #5
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Only allowing file attachments (2002)

    That sounds like what I need. How would I lock/unlock fields based on the username? Andy.

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

    Re: Only allowing file attachments (2002)

    You would handle this in the On Load event of the form, for example

    Private Sub Form_Load()
    Select Case CurrentUser
    Case "Manager", "Boss", "HeadHoncho"
    ' Unlock control for specified users
    Me.txtDocPath.Locked = False
    Case Else
    ' Lock control for everyone else
    Me.txtDocPath.Locked = True
    End Select
    End Sub

  7. #7
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Only allowing file attachments (2002)

    Hans,
    Must the Case value (headhoncho ( <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>), boss...) match the log on name (in user level security) of the person?
    Regards,
    Rudi

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

    Re: Only allowing file attachments (2002)

    From Andy's first post in this thread, I assumed that he had applied user-level security to his database. CurrentUser tells you as who the user is logged in to the database; this is only useful if user-level security has been applied; if not, everyone is automatically logged in as Admin.
    In an unsecured database, you could use the network/Windows login name instead of the Access username; see for example <post#=453041>post 453041</post#> for a function to retrieve the network login name.

  9. #9
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Only allowing file attachments (2002)

    >>>>"CurrentUser tells you as who the user is logged in to the database"
    Is the current user you refer to the login name given at login: ie, Login Name = Rudi, and password = XYZ.
    And this is the Username refered in the Case Statement??

    i'm just trying to clarify for myself!
    Regards,
    Rudi

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

    Re: Only allowing file attachments (2002)

    The Select Case statement compares the result of the CurrentUser function to a few specific names. From the online help:
    <hr>If you haven't established a secure workgroup, the CurrentUser method returns the name of the default user account, Admin. (...)

    If you have enabled workgroup security, then the CurrentUser method returns the name of the current user account. (...)<hr>
    In other words, it is the Access database username, not the Windows or network login name. Is that clear enough?

    BTW, congrats on becoming a SilverLounger!

  11. #11
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Only allowing file attachments (2002)

    There will be four users in total - (plus the Owner/Administrator). Three will have full editing rights to the database. The default user, Admin, needs to be able to insert attachments to existing records - but nothing else.
    So.. it looks like I'll have to give full editing rights to User, but to lock ALL fields on the form(s) except for the attachment field. Is this how you would approach it, bearing in mind that it's the Runtime version that they will be using? Andy.

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

    Re: Only allowing file attachments (2002)

    That seems the way to go.

    (Where I work, the functionality required for different user groups is usually so different that I create two frontends: one for those who should be able to enter, edit and delete data, and another one for those who can only view data, or edit only specific fields. So I can set everything in design view.)

  13. #13
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Only allowing file attachments (2002)

    Yes this is clear now. My original query was not about the windows login at all. I just wanted to confirm if the case values refered to the login name defined by the access security wizard.

    You have clarified that and I understand now...thanks!....(and thanks on the BTW to!)
    Regards,
    Rudi

  14. #14
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Only allowing file attachments (2002)

    >>>>>Where I work..... do you work??? (Where do you find the time to work....between WOPR an' all!?) <img src=/S/wink.gif border=0 alt=wink width=15 height=15>
    Regards,
    Rudi

Posting Permissions

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