Selecting multiple item in a list and add to another list (1 Viewer)

ssgtwally

New member
Local time
Today, 16:30
Joined
Sep 6, 2016
Messages
3
Hello,

I am having a problem with getting two listboxes to do what I want them to do.

I have "List63" that contains Employee names. In "List77", I have a list for people who attended training.

I am trying to select multiple name out of "List63", click an add button and they appear in "List77".

I would appreciate any help that I can get.

P.S. I am using Access 2013

ssgtwally
 

ssgtwally

New member
Local time
Today, 16:30
Joined
Sep 6, 2016
Messages
3
I have attached a picture of the form that I am working with.

List63's source comes from a table. I currently am using the following code:
Code:
 Private Sub cmdMoveSelRight_Click()
 
 Dim itemIndex As Variant
 For Each itemIndex In List63.ItemsSelected
   ' List0 is bound, column 1 holds the desire text to copy
   Me.List77.AddItem List63.Column(1, itemIndex)
Next
 
 End Sub
This code allows me to move names over but with the following issues:
1. The name in List63 stays highlighted, even when another name is selected. I have to manually unselect the name.
2. You can add the same name over and over again.

I have a remove button but I have not been able to get that to work, removing the names fro List77.

I am new to programming in Visual Basic, so I would appreciate any help.

ssgtwally
 

Attachments

  • Capture.jpg
    Capture.jpg
    72 KB · Views: 206

Users who are viewing this thread

Top Bottom