I'm not exactly sure what you are trying to do, but you have to set the
selected property to false, and cycle through the list:
Dim z As Integer
For z = 0 To lst.ListCount - 1 Step 1
lst.Selected(x) = False
Next z
VB has a method to clear a list box, and to clear items selected too, I
think, but VB Access does not.
John S
Aylmer, PQ
"TBernard" <(E-Mail Removed)> wrote in message
news:52f801c3b2ab$f3c23a50$(E-Mail Removed)...
> I have a from with two list boxes, the users can
> select "highlight" records in the first list box and click
> a button to add them to the 2nd list box. Everything is
> working correctly, but I cannot get the highlighted
> selecter to remove from the first list box.
>
> So if the user selects one record and clicks "Add" to add
> it to the 2nd list box, then decides they want to select
> one more record, they must first unselect the highlighted
> record (it automatically highlights the next record down
> from the previous selected record once it is removed from
> the first list box).
>
> Here is the code I have tried, but has not worked:
>
> lstMyListBox = Null
>
> and
>
> lstMyListBox = Empty
>
> Neither seem to work, if anyone has any advice or any
> ideas it would be greatly appreciated.
>
> Thank you,
>
> TBernard
|