Can anybody teel me if there is a function to display the user group of
the current user in a database with user-level security?
eg. Admins, Input-only ... etc.
Thanks
Here's a function that will display a list of all groups of which the user
is a member ...
Public Function ListGroups(ByVal UserName As String) As String
Dim usr As User
Dim grp As Group
Dim strResult As String
Set usr = DBEngine.Workspaces(0).Users(UserName)
For Each grp In usr.Groups
strResult = strResult & grp.Name & vbNullChar
Next grp
ListGroups = strResult
End Function
Here's an example of it's use, in the Immediate Window ...
? listgroups(currentuser())
Admins Users
For a function to determine whether a user is in a specified group, see the
following discussion in the Google newsgroup archives ...
http://groups.google.com/group/microsoft.public.access/browse_frm/thread/e8058ff8a64bc21e
--
Brendan Reynolds
Access MVP
<m.cr...@gmail.com> wrote in message
news:1160987325....@b28g2000cwb.googlegroups.com...
> A user can be a member of more than one group, and frequently will be, as
> all users are members of the built-in Users group. So whenever someone asks
> about displaying the name of the user's group, we have to ask: 'Which one?'
>
Hmmmm... I didn't think about that! Not an issue if all the groups are
displayed, probably better actually. Thanks for your help :-)
Where would I put this code? I have made a splash-screen which
displays all the key system info and I wanted this to display in a
textbox on this splash-screen.
Thanks