Re: Allowing User Permissions to a Control
- From: ssignore <ssignore@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 17 Apr 2009 09:43:01 -0700
Tom,
I don't speak VB so I'm not sure what needs to be swapped out to make sense
for my database.
Firstly, does the code from the article need to be edited in anyway to make
sense for a specific dbase? It look as if it does not, but again, I don't
speak this language.
I think I can figure out where to change your recommended script to
accommodate my users and we use the Windows NT ID for user name.
Second,
Would your recommended script look like the following if the Managers' NT
IDs were ssignoretto, jgutierrez, and jsottile?
dim strUser as string
strUser = fOSUserName()
if strUser = "ssignoretto" or strUser = "jgutierrez" or strUser
= "jsottile" then Me.AllowDeletes = True
else Me.AllowDeletes = False
Again, your guidance is much appreciated.
Thanks,
Simone
"Tom van Stiphout" wrote:
On Fri, 17 Apr 2009 06:15:02 -0700, ssignore.
<ssignore@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I should have written:
....and if it is other than some list of users, you set Me.AllowDeletes
to false...
The code from the article goes in a Standard Module. Anyone can call
this. Apps do this all the time. You don't have to be an
Administrator.
Yes, you will need to experiment a bit with what this function
returns. On my work computer (we're in a domain) it's different then
at home (in a workgroup). Simply set a breakpoint on the "if ..." line
and inspect the value of strUser.
The rest of the code goes in the Click event of the button.
-Tom.
Microsoft Access MVP
Tom,
Many thanks for the instructions; I guess I should have mentioned that I
also don't speak VB? (I was able to get guidance on restricting fields data
from being wiped out using a BeforeUpdate event and writing in code and I
thought I was a VB genius - for a half-second!)
I do understand the logic. The first set of code tells you who is using and
then the second set that you generously provided limits who can delete;
however, I'm muddled on where to insert this and what to change. I have a
'delete record' button. I guess I can look at the VB and see what the string
(?) is for the name.
Where does one insert the first set of code on User login? The more
important question is does one need to be an official "DBA" to get this info?
I'm not an administrator - I'm simply in a functional analysis unit and
we're doing this to help another unit try to go electronic and get rid of
their paper.
Many thanks for any additional guidance you can give me (if you have the
bandwidth!)
Thanks,
Simone
"Tom van Stiphout" wrote:
On Wed, 15 Apr 2009 08:39:01 -0700, ssignore
<ssignore@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Sure there is a way. Many ways, in fact. First off, kudos for being
cautious about security. Access' user-level security is indeed an
advanced topic you should not get into until you first download,
study, and fully understand the Security FAQ from microsoft.com. As my
friend Larry says: 30-some pages, no filler.
Here is a simpler approach. First ask Windows who is logged in:
http://www.mvps.org/access/api/api0008.htm , and if it is other than
some list of users, you set Me.AllowEdits to false:
dim strUser as string
strUser = fOSUserName()
if strUser = "my_first_user" or strUser = "my_second_user" or strUser
= "my_third_user" then Me.AllowDeletes = True
else Me.AllowDeletes = False
(change myObjectNames to yours)
-Tom.
Microsoft Access MVP
Hello, Community!
I've created a database that will be used by about six people - three of
them will be main Data Entry Users at best. Currently, there is no security
on the dbase and I think it should be fine as the Users will not go into the
backend tables. (I'm also hesitant to start applying security because I'm
really green and don't know its 'inner workings'.)
The only item that really needs to be secured is the "Delete Record" button.
We do not want the Data Entry Users to delete records accidentally.
Is there a way to allow "Delete Record" to function for three of the six
Users?
Many thanks!
ssignore
- References:
- Allowing User Permissions to a Control
- From: ssignore
- Re: Allowing User Permissions to a Control
- From: Tom van Stiphout
- Re: Allowing User Permissions to a Control
- From: ssignore
- Re: Allowing User Permissions to a Control
- From: Tom van Stiphout
- Allowing User Permissions to a Control
- Prev by Date: Re: Allowing User Permissions to a Control
- Next by Date: Re: Allowing User Permissions to a Control
- Previous by thread: Re: Allowing User Permissions to a Control
- Next by thread: Re: Allowing User Permissions to a Control
- Index(es):
Relevant Pages
|