MemberOf A97 ?

R

RedBox

Hi,

I have implemented workgroup security in a A97 database.
The users do not have security settings, they are member of groups
that have security set. I do not want so set security on userlevel,
because there are many users. So only groups have security settings
for all db-objects.
There is a form where I would like to restrict the use of certain
buttons to certain security groups, but not to individual members.

Is there a function that can test whether the currentuser() is member
of a specific security group so that I can enable access to that
button or not ?

Any other ideas ?

TIA!
 
6

'69 Camaro

Hi.
Is there a function that can test whether the currentuser() is member
of a specific security group so that I can enable access to that
button or not ?

Yes. For the VBA code, please see the tip, "How to determine whether a user
is a member of a specific group" on the following Web page:

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. (Only "Answers" have green
check-marks.) Remember that the best answers are often given to those who
have a history of rewarding the contributors who have taken the time to
answer questions correctly.
 
B

Brendan Reynolds

Public Function IsUserInGroup(ByVal strUserName As String, ByVal
strGroupName As String) As Boolean

Dim usr As DAO.User
Dim grp As DAO.Group

Set usr = DBEngine.Workspaces(0).Users(strUserName)
For Each grp In usr.Groups
If grp.Name = strGroupName Then
IsUserInGroup = True
Exit For
End If
Next grp

End Function
 
6

'69 Camaro

Geez. You'd think it was Monday morning. Let me fix this pasting job, too:

For the VBA code, please see the tip, "How to determine whether a user
is a member of a specific group" on the following Web page:

http://www.Access.QBuilt.com/html/security.html

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. (Only "Answers" have green
check-marks.) Remember that the best answers are often given to those who
have a history of rewarding the contributors who have taken the time to
answer questions correctly.
 
6

'69 Camaro

Yeah. And no caffeine yet this morning.

BTW, I'm shooting off an E-mail to you later this morning.

Gunny
 
J

Jeff Conrad

in message
Yeah. And no caffeine yet this morning.
Ouch.

BTW, I'm shooting off an E-mail to you later this morning.

No problem.
You can reach me at (e-mail address removed)

<vbg>
Kidding.
 

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