Fletcher Arnold (fl****@home.com) wrote:
: "Mark Reed" <ma*********@ntlworld.com> wrote in message
: news:7dOZb.601$8N6.471@newsfe1-win...
:> Hi,
:> Yes, this is in addition to user level security.
:>
:> Are you saying that it is possible to put all the menu's on a form
:> which is only accessible to Admin users?
:
:
: Yes. I find that it is sometimes better to make things entirely
: invisible for standard users rather than making them visible but
: disabled. It is just a question of psychology but it advertising the
: fact that there are features there which the current user has no
: permissions for may make him or her feel curious / snoopy / left out
: / whatever.
:
: In this example, there is a form with 2 tabs on it. The second tab
: contains controls intended only for db administrators so when the
: form is opened, code checks to see if the current user is a member of
: the admins group and if so makes the second page of the tab control
: visible. If the user is not an administrator, there is no
: intimidating error message - the second tab simply does not show up.
:
: I hope you can adapt the general idea to meet your needs.
:
: Fletcher
:
:
:
: Private Function AmInAdmins() As Boolean
:
: On Error GoTo Exit_Handler
:
: If
: Len(DBEngine.Workspaces(0).Groups("admins").Users( CurrentUser()).Name)
: > 0 Then
: AmInAdmins = True
: End If
:
: Exit_Handler:
: Exit Function
:
: End Function
:
:
: Private Sub Form_Open(Cancel As Integer)
:
: On Error GoTo Err_Handler
:
: If AmInAdmins() Then
: ctlTab.Pages("pge2").Visible = True
: Else
: ctlTab.Pages("pge2").Visible = False
: End If
:
: Exit_Handler:
: Exit Sub
:
: Err_Handler:
: MsgBox Err.Description, vbExclamation, "Error No: " & Err.Number
: Resume Exit_Handler
:
: End Sub
Thanks for posting this, Fletcher -- I've been wanting to do some
control hiding/unhiding based on a user's group for some time but
haven't been able to figure it out on my own.
--
http://rec-sport-golf.com/?rc=oinesroald
Please remove the under_scores if sending me mail.