D
Daama via AccessMonster.com
HI,
I am using the code below to remove items one at a time from a listbox to
another.
But I also have a nother button to remove everything at one click between two
listboxes.
Does anyone know how I can get it work?
Daama
Private Sub btnRemoveOne_Click()
Dim CN As ADODB.Connection
Dim myRS As ADODB.Recordset
Dim i As Integer
Set CN = CurrentProject.Connection
Set myRS = New ADODB.Recordset
For i = lstSelected.ListCount - 1 To 0 Step -1
If lstSelected.Selected(i) Then
lstSelected.SetFocus
lstSelectFrom.AddItem lstSelected.Value
lstSelected.RemoveItem i
End If
Next i
End Sub
I am using the code below to remove items one at a time from a listbox to
another.
But I also have a nother button to remove everything at one click between two
listboxes.
Does anyone know how I can get it work?
Daama
Private Sub btnRemoveOne_Click()
Dim CN As ADODB.Connection
Dim myRS As ADODB.Recordset
Dim i As Integer
Set CN = CurrentProject.Connection
Set myRS = New ADODB.Recordset
For i = lstSelected.ListCount - 1 To 0 Step -1
If lstSelected.Selected(i) Then
lstSelected.SetFocus
lstSelectFrom.AddItem lstSelected.Value
lstSelected.RemoveItem i
End If
Next i
End Sub