Private Sub cmdFieldOrder_Click(Index As Integer) ' 'This sub responds to the click event of 'a two-button control array called cmdFieldOrder. 'It manipulates the items in the List Box lstFields. ' Dim strList As String Dim intListIndex As Integer
Select Case Index
Case 0
With Me.lstFields
If .ListIndex > 0 Then
strList = .List(.ListIndex)
intListIndex = .ListIndex
Call .RemoveItem(.ListIndex)
Call .AddItem(strList, intListIndex - 1)
End If
End With
Case 1
With Me.lstFields
If 0 <= .ListIndex _
And .ListIndex < .ListCount - 1 Then
strList = .List(.ListIndex)
intListIndex = .ListIndex
Call .RemoveItem(.ListIndex)
Call .AddItem(strList, intListIndex + 1)
.ListIndex = intListIndex + 1
End If
End With
End Select
End Sub