programmatically delete user in group

G

Guest

Hi,

I am trying to delete a user from the group but I always
get a data type mismatch in - grpUsers.Users.Delete usr ?

Dim db As Database
Dim ws As Workspace
Dim usr As User
Dim grpUsers As Group


Set ws = DBEngine.Workspaces(0)
Set grpUsers = ws.Groups("Admins"
Set usr = grpUsers.Users("userTwo")

grpUsers.Users.Delete usr
grpUsers.Users.Refresh


What have I done wrong ?

Thank you so much!
 
J

Joan Wild

Dim ws As Workspace
Dim grpUsers as Group
Dim usr as User

Set ws = DBEngine.Workspaces(0)
Set grpUsers = ws.Groups("Admins")
Set usr = grpUsers.CreateUser("userTwo")

grpUsers.Users.Delete usr
grpUsers.Users.Refresh
 

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


Top