MobiusDick
Hippy Materialist
- Local time
- Today, 06:03
- Joined
- Aug 23, 2007
- Messages
- 23
Hi All,
I have a form with a listbox. Underneath this listbox I have a command button that selects and deselects all of the values in that list box, however, I can't seem to make it a continuos loop.
i.e. I can select the data and then deselect the data- but only once.
Does anyone have any ideas how I could change the following code to select and deselect the values in the listbox as many times as I want.
I have tried various loops and things-most of which end up in a self-perpetuating cycle.
As ever, any and all suggestions appreciated.
I have a form with a listbox. Underneath this listbox I have a command button that selects and deselects all of the values in that list box, however, I can't seem to make it a continuos loop.
i.e. I can select the data and then deselect the data- but only once.
Does anyone have any ideas how I could change the following code to select and deselect the values in the listbox as many times as I want.
I have tried various loops and things-most of which end up in a self-perpetuating cycle.
As ever, any and all suggestions appreciated.
Code:
Dim intListCount As Integer
If btnHHMPANSelector.Caption = "Select All" Then
For intListCount = 0 To lstHHMPAN.ListCount
lstHHMPAN.Selected(intListCount) = True
Next intListCount
btnHHMPANSelector.Caption = "Deselect All"
Else
For intListCount = 0 To lstHHMPAN.ListCount
lstHHMPAN.Selected(intListCount) = False
Next intListCount
btnHHMPANSelector.Caption = "Deselect All"
End If