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

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
Can you elaborate on the question. I don't quite understand what you are trying to do?
Regards,
Rudi
All's well that ends with an answer in WOPR!
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.
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.
That sounds like what I need. How would I lock/unlock fields based on the username? Andy.
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
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
All's well that ends with an answer in WOPR!
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.
>>>>"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
All's well that ends with an answer in WOPR!
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. (...)In other words, it is the Access database username, not the Windows or network login name. Is that clear enough?
If you have enabled workgroup security, then the CurrentUser method returns the name of the current user account. (...)<hr>
BTW, congrats on becoming a SilverLounger!
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.
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.)
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
All's well that ends with an answer in WOPR!
>>>>>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
All's well that ends with an answer in WOPR!