Re: specific users/command button

Tech-Archive recommends: Fix windows errors by optimizing your registry



Way more info than I need, but you made me think:
Now I just have to ask - How do I read a true/false value from a seperate
table.
As you can see below I tried Table.tbluser (my variable is tbluser) but
Table does not work?


Private Sub Form_Open(Cancel As Integer)
If Table.tblUser = True Then
Command1.Enabled = True
Else
Command1.Enable = False
MsgBox "You do not have permission to change this field."
Cancel = True
Me![DateClosed].Undo
End If

End Sub


Thanks this is Critical !!!










"Sirocco" wrote:

You can create a button that is enabled for only certain user groups, as
defined in the user/group accounts. When the form opens, the code is run,
and the button is enabled depending on the user. "CurrentUser" identifies
the current user. In the sample below, a field that was just edited by an
unqualified user is returned to its unedited state:

If CheckPermissions("Admins") = False Then
MsgBox "You do not have permission to change this field."
Cancel = True
Me![DateClosed].Undo
End If




"Dan @BCBS" <DanBCBS@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5580CE25-9B39-4744-A003-F20F1DB75A7E@xxxxxxxxxxxxxxxx
The users only have MicroSoft Runtime.
I need to add this command button to allow only a few people to be able to
delete the current record. I assume the VB code has to look at the table
for
the ones with the check box True.

I think you can start to see what I'm doing, anyone can enter a record,
but
if one needs to be deleted they need to get one of the specified people to
delete it..

Thanks




"Rick B" wrote:

Sure you can, but what prevents the user from just manually doing
whatever
the button does? If the button opens a form, or deletes a record, or
prints
a report, can't the user still do those things?

Also, I assume you will pulling the current user and comparing it to the
table?

--
Rick B



"Dan @BCBS" <DanBCBS@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2830D095-9FC7-4480-A02C-FBD7087A1E97@xxxxxxxxxxxxxxxx
Can I make a command button only work for certain people?
If I add a variable to a table (check box - Boolean) which has a list
of
users and only the users with this check box checked will be able to
click
a
command button, to everyone else it's shaded out... Can this be done?

Thanks







.


Quantcast