See if this example does what you want.
Private Sub List0_BeforeUpdate(Cancel As Integer)
Dim varItem As Variant, bolItemSelected As Boolean
For Each varItem In Me.List0.ItemsSelected
If varItem = Me.List0.ListIndex Then
bolItemSelected = True
End If
Next
If bolItemSelected Then
MsgBox "You just selected the item."
Else
MsgBox "You just unselected the item."
End If
End Sub
The ListIndex will be at the location you just clicked, so if the item you
just clicked is in the ItemsSelected list then you just selected the item.
If it's not in the list, you just deselected the item.
--
Wayne Morgan
MS Access MVP
<ma**********@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Using 2003. How do I tell if a selected item on a multi-select listbox
is now unselected? If a user unselects an item, I want to prompt them
that they've unselected it. No prompt if they're selecting an item.
I tried the following code but it displays the test message whether
they're selecting or unselecting:
For intRow = 1 To Me.lstEmployees.ListCount - 1
If Me.lstEmployees.Selected(intRow) = False Then
MsgBox "Previously selected"
Exit For
End If
Next intRow
Thanks for any help or advice.