UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Disable "remove" And/or "add" Buttons From Attachment Control, Access 2016    
 
   
rhubbell
post Apr 15 2018, 06:38 AM
Post#1



Posts: 8
Joined: 17-February 04



Is there a way to disable the "Remove" and/or "Add" buttons from the Attachment Control? I want to allow one group of users to add/remove attachments, but another group to only have the ability to open attachments but not add or delete. Thanks in advance!
Go to the top of the page
 
GroverParkGeorge
post Apr 15 2018, 07:47 AM
Post#2


UA Admin
Posts: 34,074
Joined: 20-June 02
From: Newcastle, WA


"Attachment control"?

Am I assuming correctly that this is a control bound to a multivalued field in a table?

What you should be able to do, although I've not tried it, would be to define your groups (admins, data entry, etc.) and have users log in. By checking which group each user is in, you can set the enabled property of controls on forms when they are opened.



Go to the top of the page
 
projecttoday
post Apr 15 2018, 07:55 AM
Post#3


UtterAccess VIP
Posts: 10,347
Joined: 10-February 04
From: South Charleston, WV


Do you have any existing functionality based on user class?

You should be aware that multi-value table fields (if that's what you're using) are not recommended.

Go to the top of the page
 
rhubbell
post Apr 15 2018, 08:22 AM
Post#4



Posts: 8
Joined: 17-February 04



Thanks for your replies.... So, the purpose of the database is for our drafting department to issue a pdf file of a schematic for review by engineering and ops. In my table I have two attachment files....Orig_Attachments and Mod_Attachments. My intent is for drafting (thru a form) to have add/delete functionality for Orig_Attachments but engineering and ops to only be able to open. If there are any changes required ops or engineering would have the ability to add a modified schematic to Mod_Attachments, again, through a form.

So I haven't added user level access controls to the application yet. My question is basically this: Are there properties of the attachment control/object on a form that, through VBA, I can prevent users from selecting the Add and Delete buttons?

Projecttoday: I'm more of an Access hack so I don't quite understand your comment about multi-value table fields (which I assume is what a attachment data type is) not being recommended. How should I be handling attachments then?

Again, many thanks for your help! - Rob
Go to the top of the page
 
GroverParkGeorge
post Apr 15 2018, 09:17 AM
Post#5


UA Admin
Posts: 34,074
Joined: 20-June 02
From: Newcastle, WA


I think we need to establish a base line to be sure we're on the same page.

There are two separate issues at work here: The use of the Attachment field and the ability to control access to the controls for that field.

First, the Attachment field IS one implementation of a Multi-Valued Field. Access allows them, but most serious Access developers have learned that they tend to be more problematic than helpful, and try to avoid them.

Attached File  attachmentfieldExpanded.jpg ( 70.72K )Number of downloads: 2


That's what they look like, right?

What's going to happen is that you'll embed all of those binary files internally in a table INSIDE your accdb. Bloat is the term we use to describe the resulting increase in file size. And bloat can lead to performance problems, at the least. For many, very small processes, it might not be dramatic or problematic initially, and it'll be a while before the bloated accdb begins to exhibit symptoms associated with that. Best not to go there, especially if, as it sounds, you intend to support a significant element of your business with this database.

Instead, store those files externally, in a folder or folders set up for that purpose. You can structure the folder so that it has subfolders for each project you work on. You can give your drafters read/write permissions on those folders, and read-only permissions to the consumers of those schematics. That's starting to branch over into the security side, btw.

Now, in the table, put a field containing the path to each schematic in its folder, NOT the schematic itself. When your users want to look at a schematic, use the FollowHyperLink method to open the schematic from it's home folder.

To properly control access to the schematics, you'll have to have a way to distinguish groups of users--drafters vs. engineers. This should be done based on their Windows Accounts. If this is set up properly by IT, you probably don't even need to distinguish between them in Access because you can use Active Directory groups to give each user the appropriate level of access (read/write vs read-only) to the folders where the files reside. You probably need to work closely with IT to make sure this is all set up correctly. And I can foresee one other problem. I'm not sure how you could prevent an engineer from opening a read-only copy of a schematic, but then save it back to a different location where they could change it. Of course, they couldn't put the changed version back over the top of the original, but you could end up with multiple versions floating around. Still, you'll have one source of truth for each schematic to rely on.

I think you'll get some good suggestions for specific implementations by searching our code archives. This is a fairly common requirement and there have been a number of discussions.

Go to the top of the page
 
projecttoday
post Apr 15 2018, 11:14 AM
Post#6


UtterAccess VIP
Posts: 10,347
Joined: 10-February 04
From: South Charleston, WV


So you're not using multi-value fields?

Confirm that you are using an attachment control.

So where are the Add and Delete buttons you're talking about? They're not part of the control, are they?
Go to the top of the page
 
rhubbell
post May 15 2018, 08:31 AM
Post#7



Posts: 8
Joined: 17-February 04



GroverParkGeorge - Thank you very much for answering my question....and yes I am using the attachment control. I can see where "bloat" can and will eventually be an issue. For now the attachment control is working but I will look to implementing hyperlinks when I have time to work on it. Thanks again for your help!

projecttoday - Thanks as well. You were cautioning me against using the attachment control as well. Thanks for pointing me in the right direction.
This post has been edited by rhubbell: May 15 2018, 08:33 AM
Go to the top of the page
 
zaxbat
post May 15 2018, 09:05 AM
Post#8



Posts: 1,184
Joined: 26-January 06
From: .....the wiregrass (either you know or you don't)


Please be careful throwing the term hyperlink around carelessly. Hyperlink is an access data type and you do not want to use that. You simply want to store the path and filename to the various files in a table(s) as text data types.
This post has been edited by zaxbat: May 15 2018, 09:14 AM
Go to the top of the page
 
projecttoday
post May 15 2018, 10:28 AM
Post#9


UtterAccess VIP
Posts: 10,347
Joined: 10-February 04
From: South Charleston, WV


You're welcome.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    10th December 2018 - 12:25 PM