B
Bassel
Hello
I am trying to show users of a certain group , by selecting the group name
from a listbox.
The code is
Private Sub command2_click()
Call EnumGroupUsers(Me.List10)
End Sub
****Where list 10 contains the groups
Public Sub EnumGroupUsers(strGroup As String)
Dim wrk As DAO.Workspace
Dim varUser As Variant
Dim ListUser As String
Set wrk = DBEngine(0)
For Each varUser In wrk.Groups(strGroup).Users
ListUser = ListUser & vbTab & varUser.Name & ";"
Me.List7.RowSource = ListUser
Next varUser
Set wrk = Nothing
Where List7 will hold the output.
End Sub
If use this code it gives an error Item not found in this collection.
(Error 3265).
However if I type strGroup , it works fine.
Can you please help me.
Bassel
I am trying to show users of a certain group , by selecting the group name
from a listbox.
The code is
Private Sub command2_click()
Call EnumGroupUsers(Me.List10)
End Sub
****Where list 10 contains the groups
Public Sub EnumGroupUsers(strGroup As String)
Dim wrk As DAO.Workspace
Dim varUser As Variant
Dim ListUser As String
Set wrk = DBEngine(0)
For Each varUser In wrk.Groups(strGroup).Users
ListUser = ListUser & vbTab & varUser.Name & ";"
Me.List7.RowSource = ListUser
Next varUser
Set wrk = Nothing
Where List7 will hold the output.
End Sub
If use this code it gives an error Item not found in this collection.
(Error 3265).
However if I type strGroup , it works fine.
Can you please help me.
Bassel