Private Sub cmdSelectAllFields_Click()
Dim intIndex As Integer
intIndex = 0
Do While intIndex < lstIncludedFields.ListCount
lstIncludedFields.Selected(intIndex) = (cmdSelectAllFields.Caption = "Select All")
intIndex = intIndex + 1
Loop
If cmdSelectAllFields.Caption = "Select All" Then
cmdSelectAllFields.Caption = "Deselect All"
Else
cmdSelectAllFields.Caption = "Select All"
End If
'lstIncludedFields.ListIndex = lstIncludedFields.ListCount - 1
lstIncludedFields.Requery
End Sub
|