Sure, but it would involve some coding and a change to the table structure
of the table that provides the data for your listbox.
1. Add an IsSelected (Yes/No) field to the table
2. Add it to the query that supports your listbox. Mine looks like:
SELECT intValue, SomeLetter, SomeDate, tbl_Number.IsSelected
FROM tbl_Number
ORDER BY tbl_Number.IsSelected, tbl_Number.intValue;
Note that this is sorted first by the IsSelected field, then by the field
you want to use as your primary sort field.
3. Add code similiar to the following to the click event of the listbox:
Basically, what this does is set the IsSelected value in the table to the
Selected property of each of the items in the listbox. It then requeries
the listbox and sets the Selected property of the list item based on the
value of the IsSelected field
If your list contains a lot of info, this might take a while, but with small
lists, it should not be noticable.
Private Sub lst_Numbers_Click()
Dim intLoop As Integer
Dim strSQL As String
For intLoop = 0 To Me.lst_Numbers.ListCount - 1
strSQL = "UPDATE tbl_Number SET IsSelected = " &
Me.lst_Numbers.Selected(intLoop) _
& " WHERE intValue = " & Me.lst_Numbers.Column(0, intLoop)
Debug.Print strSQL
CurrentDb.Execute strSQL
Next
Me.lst_Numbers.Requery
For intLoop = 0 To Me.lst_Numbers.ListCount - 1
Me.lst_Numbers.Selected(intLoop) = Me.lst_Numbers.Column(3, intLoop)
Next
End Sub
HTH
Dale