1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Private Sub cmdCopy_Click()
CopySelection Me
End Sub
Public Sub CopySelection(ByRef frm As Form)
Dim ctlSource As Control
Dim ctlDest As Control
Dim strItems As String
Dim intCurrentRow As Integer
Set ctlSource = frm!lstComplète
Set ctlDest = frm!lstTriée
For intCurrentRow = 0 To ctlSource.ListCount - 1
If ctlSource.Selected(intCurrentRow) Then
strItems = strItems & ctlSource.Column(0, _
intCurrentRow) & ";"
End If
Next intCurrentRow
ctlDest.RowSource = ""
ctlDest.RowSource = strItems
Set ctlSource = Nothing
Set ctlDest = Nothing
End Sub |
Partager