G Guest Mar 2, 2005 #1 Is there a way using VBA to unselect (deselect) all entries in a multi-select or single-select listbox? Thanks in advance for your help!
Is there a way using VBA to unselect (deselect) all entries in a multi-select or single-select listbox? Thanks in advance for your help!
D Dirk Goldgar Mar 2, 2005 #2 PeterM said: Is there a way using VBA to unselect (deselect) all entries in a multi-select or single-select listbox? Thanks in advance for your help! Click to expand... A single-select list box is easy: just set its value to Null. For a multiselect list box: '----- start of code ----- Function ClearListBoxSelections(lst As Access.ListBox) Dim intI As Integer With lst For intI = (.ItemsSelected.Count - 1) To 0 Step -1 .Selected(.ItemsSelected(intI)) = False Next intI End With End Function '----- end of code -----
PeterM said: Is there a way using VBA to unselect (deselect) all entries in a multi-select or single-select listbox? Thanks in advance for your help! Click to expand... A single-select list box is easy: just set its value to Null. For a multiselect list box: '----- start of code ----- Function ClearListBoxSelections(lst As Access.ListBox) Dim intI As Integer With lst For intI = (.ItemsSelected.Count - 1) To 0 Step -1 .Selected(.ItemsSelected(intI)) = False Next intI End With End Function '----- end of code -----