I've done this before, but I can't work out the syntax just now. I want to change the value of every checkbox on my form (40 of them) to True by clicking on a button. The functionality is already there (written by a previous developer) explicitly naming each one and setting the value to True, i.e. "Me.chkOne = True". I'd like to cycle through the with a For Each .... Next statement. Something like this.
I've tried a lot of variations on this and just dug myself in deeper.Code:Private Sub cmdSelectAllReports_Click()Dim chkBox As CheckBox, ctls As Collection For Each chkBox In ctls chkBox.Value = True Next chkBoxEnd Sub
Hoping you can help.
Thanks, Paul


Cycling through a collection of controls
Reply With Quote

