Home All Groups Group Topic Archive Search About

VBA UserGroup Variable

Author
3 Nov 2007 10:17 AM
Jezzyjez
What is the variable name for the value of the usergroup name for example:

If Usergroup = "Admin" Then
MsgBox ("Test")
End If

I have just put Usergroup in as the variable name but this does not work
what name should be used?

Author
3 Nov 2007 11:36 AM
Douglas J. Steele
Are you saying that you're trying to determine the user group to which the
current user belongs? There's no such function, since a user can belong to
more than one group.

See
http://support.microsoft.com/default.aspx?scid=%2Fsupport%2Faccess%2Fcontent%2Fsecfaq.asp#_Toc493299691
to determine whether or not a user belongs to a particular group, or return
a lists of all of the groups to which the current user belongs.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


Show quote
"Jezzyjez" <Jezzy***@discussions.microsoft.com> wrote in message
news:7EFB60B2-D881-48FA-8243-882ADFF0854D@microsoft.com...
> What is the variable name for the value of the usergroup name for example:
>
> If Usergroup = "Admin" Then
> MsgBox ("Test")
> End If
>
> I have just put Usergroup in as the variable name but this does not work
> what name should be used?
Author
3 Nov 2007 4:40 PM
Jezzyjez
Ok i get where your coming from there, what i need to achieve is when people
from user group A log in frmA opens, and when people from user group B log in
frmB opens so i have created a macro to be run on startup with simular code
as to shown below but this obviously doesnt work

Show quote
"Douglas J. Steele" wrote:

> Are you saying that you're trying to determine the user group to which the
> current user belongs? There's no such function, since a user can belong to
> more than one group.
>
> See
> http://support.microsoft.com/default.aspx?scid=%2Fsupport%2Faccess%2Fcontent%2Fsecfaq.asp#_Toc493299691
> to determine whether or not a user belongs to a particular group, or return
> a lists of all of the groups to which the current user belongs.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Jezzyjez" <Jezzy***@discussions.microsoft.com> wrote in message
> news:7EFB60B2-D881-48FA-8243-882ADFF0854D@microsoft.com...
> > What is the variable name for the value of the usergroup name for example:
> >
> > If Usergroup = "Admin" Then
> > MsgBox ("Test")
> > End If
> >
> > I have just put Usergroup in as the variable name but this does not work
> > what name should be used?
>
>
>
Author
3 Nov 2007 5:49 PM
Douglas J. Steele
Did you bother checking the reference I gave?

You can use

If faq_IsUserInGroup ("Admins", CurrentUser)  Then
  MsgBox "Test"
End If

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


Show quote
"Jezzyjez" <Jezzy***@discussions.microsoft.com> wrote in message
news:92343A82-FC4C-4390-9367-2C572B55FD5A@microsoft.com...
> Ok i get where your coming from there, what i need to achieve is when
> people
> from user group A log in frmA opens, and when people from user group B log
> in
> frmB opens so i have created a macro to be run on startup with simular
> code
> as to shown below but this obviously doesnt work
>
> "Douglas J. Steele" wrote:
>
>> Are you saying that you're trying to determine the user group to which
>> the
>> current user belongs? There's no such function, since a user can belong
>> to
>> more than one group.
>>
>> See
>> http://support.microsoft.com/default.aspx?scid=%2Fsupport%2Faccess%2Fcontent%2Fsecfaq.asp#_Toc493299691
>> to determine whether or not a user belongs to a particular group, or
>> return
>> a lists of all of the groups to which the current user belongs.
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no private e-mails, please)
>>
>>
>> "Jezzyjez" <Jezzy***@discussions.microsoft.com> wrote in message
>> news:7EFB60B2-D881-48FA-8243-882ADFF0854D@microsoft.com...
>> > What is the variable name for the value of the usergroup name for
>> > example:
>> >
>> > If Usergroup = "Admin" Then
>> > MsgBox ("Test")
>> > End If
>> >
>> > I have just put Usergroup in as the variable name but this does not
>> > work
>> > what name should be used?
>>
>>
>>
Author
6 Nov 2007 2:56 PM
Jezzyjez
Neither MSysAccounts or MSysGroups appear when I show system objects??

Show quote
"Douglas J. Steele" wrote:

> Did you bother checking the reference I gave?
>
> You can use
>
> If faq_IsUserInGroup ("Admins", CurrentUser)  Then
>   MsgBox "Test"
> End If
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Jezzyjez" <Jezzy***@discussions.microsoft.com> wrote in message
> news:92343A82-FC4C-4390-9367-2C572B55FD5A@microsoft.com...
> > Ok i get where your coming from there, what i need to achieve is when
> > people
> > from user group A log in frmA opens, and when people from user group B log
> > in
> > frmB opens so i have created a macro to be run on startup with simular
> > code
> > as to shown below but this obviously doesnt work
> >
> > "Douglas J. Steele" wrote:
> >
> >> Are you saying that you're trying to determine the user group to which
> >> the
> >> current user belongs? There's no such function, since a user can belong
> >> to
> >> more than one group.
> >>
> >> See
> >> http://support.microsoft.com/default.aspx?scid=%2Fsupport%2Faccess%2Fcontent%2Fsecfaq.asp#_Toc493299691
> >> to determine whether or not a user belongs to a particular group, or
> >> return
> >> a lists of all of the groups to which the current user belongs.
> >>
> >> --
> >> Doug Steele, Microsoft Access MVP
> >> http://I.Am/DougSteele
> >> (no private e-mails, please)
> >>
> >>
> >> "Jezzyjez" <Jezzy***@discussions.microsoft.com> wrote in message
> >> news:7EFB60B2-D881-48FA-8243-882ADFF0854D@microsoft.com...
> >> > What is the variable name for the value of the usergroup name for
> >> > example:
> >> >
> >> > If Usergroup = "Admin" Then
> >> > MsgBox ("Test")
> >> > End If
> >> >
> >> > I have just put Usergroup in as the variable name but this does not
> >> > work
> >> > what name should be used?
> >>
> >>
> >>
>
>
>

AddThis Social Bookmark Button