Listbox 1st item [Any]

Allow user to select [Any] as first item in list that will deselect all other selected items.
Then prevent user from selecting any item until [Any] is deselected.
1st item in list [Any] should already been added to list.
Can use more work to make it easier to include

CodeFunctionName
What is this?

Public

Tested

Original Work
' Define as public variable on module-level
Public CodeChange As Integer



Private Sub Lst2_Change()
    '
    If Lst2.ListIndex < 0 Then Exit Sub
    If CodeChange = 1 Then Exit Sub
    CodeChange = 1
    If Lst2.Selected(0) Then
        For I = 2 To Lst2.ListCount
            Lst2.Selected(I - 1) = False
        Next
    End If
    CodeChange = 0
End Sub

Views 104

Downloads 68

CodeID
DB ID