move all items at one click

  • Thread starter Thread starter Daama via AccessMonster.com
  • Start date Start date
D

Daama via AccessMonster.com

Hi ,

How can I move all items in a list box at on click?

I am using the code below but it's moving item one at at ime:


Private Sub btnMoveAll_Click()

Me.lstSelected.SetFocus
Me.lstSelectFrom.SetFocus

Me.lstSelected.RowSource = Me.lstSelectFrom.Value
Me.lstSelected.RowSourceType = "value list"
End Sub
 
Hi ,

How can I move all items in a list box at on click?

I am using the code below but it's moving item one at at ime:

Private Sub btnMoveAll_Click()

Me.lstSelected.SetFocus
Me.lstSelectFrom.SetFocus

Me.lstSelected.RowSource = Me.lstSelectFrom.Value
Me.lstSelected.RowSourceType = "value list"
End Sub


Private Sub btnMoveAll_Click()

Dim strRow As String
Dim X As Integer

Me!lstSelected.RowSourceType = "value list"

For X = 0 To Me.lstSelectFrom.ListCount - 1
strRow = strRow & Me!lstSelectFrom.ItemData(X) & ","
Next X
strRow = Left(strRow, Len(strRow) - 1)

Me!lstSelected.RowSource = strRow
End Sub
 
Back
Top