Update status of "select all" checkbox

  • Thread starter Thread starter celinesuzzarini
  • Start date Start date
C

celinesuzzarini

Hi All,

I currently have a multiselect list box and a check box.
When the check box is checked, it selects everything I have in the list
box.
Now, if I deselect a few items in the list box, then the check box
should be unchecked... and if I manually reselect everything, then the
check box should be checked.
Is there any way to do it without have to check every item in the list
(kind of slow)?

Thanks,
Celine
 
How about a Select All command button?
In the click event, programmatically make every item in the list selected?

Here is a procedure you can use that will select all items or clear all
items. Make "Select All" the Caption property in Design view of the form so
it will start in the correct place.

Public Sub SelAll()
Dim lngCtr As Long
Dim blnSelectAll As Boolean

blnSelectAll = Me.CmdSelect.Caption = "Select All"
For lngCtr = 0 To Me.lstBillProdOffering.ListCount - 1
Me.lstBillProdOffering.Selected(lngCtr) = blnSelectAll
Next lngCtr
Me.CmdSelect.Caption = IIf(blnSelectAll, "Clear All", "Select All")
End Sub
 
OK, that's really smart!! lol!! I didn't even think about it!! I was so
much into my check box!

Thanks!
Celine
 
Back
Top