D
Daama via AccessMonster.com
Hi All,
I am using the code below to move up the items in a list box named
lstSelected
(for the move down, I just use the reverse )
But I keep getting an error message pointing to the word (.list) that is in
the line:
tmp = lstSelected.List(intg)
The message say: "Compile Error: Method or data number not found"
Can anyone help me figure out what is wrong with the code.
P.S. I also check some of the solutions posted, I keep running on the same
problem.
Thanks,
Daama
Dim tmp As String
Dim intg As Integer
index = lstSelected.ListIndex
'something's selected
If intg > -1 Then
'and its not at the top already
If intg > 0 Then
tmp = lstSelected.List(intg)
lstSelected.RemoveItem intg
lstSelected.AddItem tmp, intg - 1
lstSelected.Selected(intg - 1) = True
lstSelected.SetFocus
End If
End If
End Sub
I am using the code below to move up the items in a list box named
lstSelected
(for the move down, I just use the reverse )
But I keep getting an error message pointing to the word (.list) that is in
the line:
tmp = lstSelected.List(intg)
The message say: "Compile Error: Method or data number not found"
Can anyone help me figure out what is wrong with the code.
P.S. I also check some of the solutions posted, I keep running on the same
problem.
Thanks,
Daama
Dim tmp As String
Dim intg As Integer
index = lstSelected.ListIndex
'something's selected
If intg > -1 Then
'and its not at the top already
If intg > 0 Then
tmp = lstSelected.List(intg)
lstSelected.RemoveItem intg
lstSelected.AddItem tmp, intg - 1
lstSelected.Selected(intg - 1) = True
lstSelected.SetFocus
End If
End If
End Sub