User Group reference

D

Denise Bosch

Does anyone know if there is a function equivalent to CurrentUser(), which
would return the group that the current user belongs to?

THanks!
 
T

TC

A user can belong to any number of groups - not just one. For example, the
Admin user is often a member of the Admins group >and< the Users group.

Try this: (untested)

debug.print "groups for "; currentuser()
dim g as group
for each g in dbengine(0).groups
debug.print g.name
next

HTH,
TC
 
D

Denise Bosch

How about if I want to check - for example:

If user is a member of group=Supervisor then.....

Any thoughts?

Thanks
 
T

TC

(untested)

dim bIsMember as boolean, s as string
on error resume next
s = dbengine(0).groups("Supervisor").name
bIsMember = (err.number = 0)
on error goto 0
' now IsMember is True or False, accordingly.

Or you could put that code in a function, and pass the desired group name as
a parameter.

HTH,
TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top