B Byron Jan 26, 2004 #1 How can I programatically clear all selections made in a listbox that is designated as multi-select.
T TC Jan 26, 2004 #2 Try: me![lstMyListbox].itemsselected.count = 0 but I don't have Access here to check, so I may be wrong on that. HTH, TC
Try: me![lstMyListbox].itemsselected.count = 0 but I don't have Access here to check, so I may be wrong on that. HTH, TC
? ___ Jan 26, 2004 #3 In the OnClick event of a button, put the following code changin "YourListBox" to the name of your listbox... Code ------------------- Dim varItem As Variant For Each varItem In Me.YourListBox.ItemsSelected Me.YourListBox.Selected(varItem) = False Next varItem
In the OnClick event of a button, put the following code changin "YourListBox" to the name of your listbox... Code ------------------- Dim varItem As Variant For Each varItem In Me.YourListBox.ItemsSelected Me.YourListBox.Selected(varItem) = False Next varItem
M Marshall Barton Jan 26, 2004 #4 TC said: Try: me![lstMyListbox].itemsselected.count = 0 but I don't have Access here to check, so I may be wrong on that. Click to expand... I checked, the Count property is read only, so rhat won't work.
TC said: Try: me![lstMyListbox].itemsselected.count = 0 but I don't have Access here to check, so I may be wrong on that. Click to expand... I checked, the Count property is read only, so rhat won't work.
M Marshall Barton Jan 26, 2004 #5 Byron said: How can I programatically clear all selections made in a listbox that is designated as multi-select. Click to expand... I seem to remember that this is a tricky issue and that List0.RowSource = List0.RowSource was a good way to do it.
Byron said: How can I programatically clear all selections made in a listbox that is designated as multi-select. Click to expand... I seem to remember that this is a tricky issue and that List0.RowSource = List0.RowSource was a good way to do it.
D Dirk Goldgar Jan 26, 2004 #6 Byron said: How can I programatically clear all selections made in a listbox that is designated as multi-select. Click to expand... I've used this: Dim intI As Integer With Me.lstMyListBox For intI = (.ItemsSelected.Count - 1) To 0 Step -1 .Selected(.ItemsSelected(intI)) = False Next intI End With You must substitute your list box's name for "lstMyListBox".
Byron said: How can I programatically clear all selections made in a listbox that is designated as multi-select. Click to expand... I've used this: Dim intI As Integer With Me.lstMyListBox For intI = (.ItemsSelected.Count - 1) To 0 Step -1 .Selected(.ItemsSelected(intI)) = False Next intI End With You must substitute your list box's name for "lstMyListBox".
P PC Datasheet Jan 26, 2004 #7 For I = 0 To Me!lstDirList.ListCount - 1 Me!lstDirList.Selected(I) = SetSelected Next Set SetSelected to false to clear selections and true to select all selections
For I = 0 To Me!lstDirList.ListCount - 1 Me!lstDirList.Selected(I) = SetSelected Next Set SetSelected to false to clear selections and true to select all selections