Access XP Data Type problem in Module

  • Thread starter Thread starter Steve
  • Start date Start date
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
 
make sure you have a reference to DAO 3.6 in menu tools-references dialog,
then it will work
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Item not found in this collection error 1
Module of User In Group 4
Find Current Group problem 2
Security FAQ code problems 3
Show GrouP users using list box 1
Listing PIDs 3
User and Group information 5
Syntax 1

Back
Top