dynamic form checkbox question

  • Thread starter Thread starter Gary Keramidas
  • Start date Start date
G

Gary Keramidas

i create a series of checkboxes dynamically.
Set newButton5 = Me.Controls.Add("Forms.checkbox.1")
newButton5.Value = False
With newButton5
.name = checkbox & i & "C"
End With

i know how to get the value of these controls, but how do i act on an event?

"Private Sub Checkbox1c _click()" doesn't work.
 
Don't create them dynamically, create them in design, and setup the click
events, and hide them, unhiding when required.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
So create 40 and unhide the ones you want.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Honestly Gary, it is the best way. Creating controls on the fly is bad news,
hard to manage, hard to maintain. If all the controls react the same way,
you can use application events to easily control them.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
i just created all of them and piled them all on top of each other using the
align menu option. i needed 40 checkboxes, too.
 
Back
Top