1. Click the Modules tab of the Database window.
2. Click New.
Access opens a new module.
3. Paste the code in.
4. Check Access understands it: choose Debug on Compile menu.
5. Save the module with a name such as Module1.
6. Change the first line of your code like this:
If IsUserInGroup(CurrentUser(), "Update Data Users") Then
Since you are talking about users and groups, I assume you do have Access
security (mdw) set up.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"LDMueller" <(E-Mail Removed)> wrote in message
news:3C87531F-D99D-4B1F-8DCE-(E-Mail Removed)...
> Hi Allen,
>
> First of all, thank you so much for your quick response and for your
> assistance.
>
> I'm pretty limited in what I know this this stuff so other than copying
> the
> function you provided into my code, I still don't know what to do.
>
> Sorry... Could you possibly direct me further?
>
> Thanks,
>
> LDMueller
>
> "Allen Browne" wrote:
>
>> Function IsUserInGroup(strUser As String, strGroup As String) As Boolean
>> Dim varDummy As Variant
>> On Error Resume Next
>> varDummy = DBEngine(0).Users(strUser).Groups(strGroup).Name
>> IsUserInGroup = (Err.Number = 0)
>> End Function
>>
>> "LDMueller" <(E-Mail Removed)> wrote in message
>> news:8B58F3A9-E963-4E9F-9DA0-(E-Mail Removed)...
>> >I need to be able to determine if a user is a member of the "Update Data
>> > Users" Access security group and if they are then I'll allow them to
>> > see
>> > more
>> > command buttons on my form.
>> >
>> > The code would be something like the following:
>> >
>> > If current user is in "Update Data Users" group then
>> > Me.cmdEditRecord.Visible = True
>> > else
>> > Me.cmdEditRecord.Visible = False
>> > end if
>> >
>> > Any help would be greatly appreciated.