programmatically delete user in group

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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
 
Back
Top