Problem with list box

G

Guest

Hello
I am using a list box List10 to list the access groups.
I am using another listbox list7 to list users
This function is working fine if i input the group name as string.
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
End Sub

When I try to use a selected item from list10(Groupslist). It gives the
error. "Item not found in this collection"
This is the code to choose from list 10
Private Sub Command2_Click()
EnumGroupUsers (Me.List10)
End Sub

Please Help Me
 

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