Ok I am confused. I read and re-read the information, but I am still
uncertain on how to invoke this. All I am trying to do is caputure the
log-in user name. Then when the program opens a hidden form will check to
see if they belong to this group, if so run this procedure and open this form
else run this other procedure and open a different form.
I saw this in one of the messages here and modified a little.
' Function: isMemberOfGrp( )
' Returns True if the user is in the group.
' Usage: isMemberOfGrp(CurrentUser(), "Admins")
'=======================================
Public Function isMemberOfGrp(sUserName As String, sGrpName As String)
On Error Resume Next
Dim memID As String
memID = DBEngine(0).Users(sUserName).Groups(sGrpName).Name
'-------------------------------------------------------------------
' Determine whether checking this Property
' caused an error or not.
'-------------------------------------------------------------------
If (Err.Number = 0) Then
isMemberOfGrp = True
Else
isMemberOfGrp = False
End If
End Function
Then onload event of the hidden form I have.
If isMemberOfGrp(CurrentUser(), "RegAdmin") Then
run this procedure blah blah
ElseIf isMemberOfGrp(CurrentUser(), "NormUser") Then
run this procedure blah blah
end if
"Lynn Trapp" wrote:
> See section 22 of the Security FAQ. You can find a link to it on the
> Security page of my website.
>
> --
> Lynn Trapp
> MS Access MVP
> www.ltcomputerdesigns.com
> Access Security: www.ltcomputerdesigns.com/Security.htm
> Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html
>
>
> "Fysh" <(E-Mail Removed)> wrote in message
> news:76BF2DED-FB7A-498B-BD38-(E-Mail Removed)...
> >I have a DB using the User-Security Level which has just 3 groups. The
> > SuperAdmin, the RegAdmin, and the normal user. Currently when the program
> > starts up I have it set to display a form, which is hidden and runs some
> > procedures. However, it now needs to be changed to determine which group
> > the
> > user belongs to when signing in. From the log-in I need to display a
> > separate form. For instance the RegAdmin needs to have a maintenance form
> > appear first, which the normal user will not have access to. How do I
> > capture which group the person signed as and then use this info to
> > determine
> > which form is displayed first in the Starup under tools?
> >
> > Thanks
>
>
>