Show GrouP users using list box

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
 

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

Top