Access XP Data Type problem in Module

S

Steve

We use a module in our '97 databases that determine if a
user is a member of a group in the Access MDW security
file. It does not work in XP. It's a great function and
we would like to use it in the future. Here it is

Public Function Memberof(strGroup as string) as Boolean
dim wrk as Workspace
dim usr as User
dim grp as Group
set wrk = DBEngine.workspaces (0)
set Usr = wrk.user (currentUser)

With usr
if .Groups.count <> 0 then
for each grp in .Group
if grp.Name = strGroup then Memberof = True
next grp
End if
End with
end Function.

Any Idea how we can re-write this? XP does not recognize
the data types. 2003 does.

Thanks
Steve
 
A

Alex Dybenko

make sure you have a reference to DAO 3.6 in menu tools-references dialog,
then it will work
 
T

TC

Public Function Memberof(strGroup as string) as Boolean
dim s as string
on error resume next
s = dbengine(0).users(currentuser()).groups(strGroup).name
memberOf = (err.number = 0)
end function

:)
TC
 
Top