Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to check current group? 1

Status
Not open for further replies.

tobymom

Programmer
Aug 18, 2006
36
US
OS: xp pro
Office: XP

I want to code following...

If currentgroup = "manager" then
open form name "frmManager"
else
open form name "frmOthers"
end if

I understand there's a function "CurrentUser()" to check current user. However, I couldn't find embedded function checking a user's current group.

I guess I'll have to figure out going around this... If anyone have any ideas, it'll be greatly appreciated.

thanks!

 
Here's an function you could try:
Code:
Public Function gfIsManager%()
Dim usr As User
    For Each usr In DBEngine(0).Groups("Manager").Users
        If usr.Name = CurrentUser() Then
            gfIsManager = True
            Exit For
        End If
    Next
End Function


Max Hugen
Australia
 
I haven't tried your code but it looks very promising. Thank you very much for your valuable time.

Regards,

Tobymom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top