Deselecting from a List Box

roland_access

Registered User.
Local time
Today, 05:45
Joined
Feb 13, 2002
Messages
35
Using Access 2000, I have a form with a simple multi select list box. The user selects items from the box and clicks a command button, which runs code based on the selection in the list box. These entries may change as a result of the command, so the list box refreshes and updates, but the selection / highlight remains where it is, now selecting the wrong data.

Is there any code I can attach to the command button that deselects anything highlighted in the list box?
 
Code:
Dim var As Variant
For Each var In Me.MyListbox.ItemsSelected
    Me.MyListbox.Selected(var) = False
Next
 
worked perfectly, many thanks.
 

Users who are viewing this thread

Back
Top Bottom