Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can't Trigger Event Procedure from a Checkbox created on the Fly.
I'm creating a checkbox on the fly in a form. I know that the checkbox
name will be CkBox1 so I already created the following event procedure. For some reason I can't get the event procedure to trigger when I click on the checkbox that was created. I'm sure that it has something to do with the fact that I'm creating procedure before the control is created, but I would imagine there has to be a way. And due to the fact that this form needs to be very dynamic, I can't really get away with just creating the controls and hiding/unhiding them. Any suggestions would be appreciated. Thanks, James Private Sub CkBox1_Change() If PackageForm.Controls("CkBox1").Value = True Then With PackageForm.Controls("TBox4") .Enabled = True .Locked = False .BackStyle = fmBackStyleOpaque End With Else With PackageForm.Controls("TBox4") .Enabled = False .Locked = True .BackStyle = fmBackStyleTransparent .Value = "" End With End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can't Trigger Event Procedure from a Checkbox created on the Fly.
JGeniti wrote: I'm creating a checkbox on the fly in a form. I know that the checkbox name will be CkBox1 so I already created the following event procedure. For some reason I can't get the event procedure to trigger when I click on the checkbox that was created. I'm sure that it has something to do with the fact that I'm creating procedure before the control is created, but I would imagine there has to be a way. And due to the fact that this form needs to be very dynamic, I can't really get away with just creating the controls and hiding/unhiding them. Any suggestions would be appreciated. Thanks, James Private Sub CkBox1_Change() If PackageForm.Controls("CkBox1").Value = True Then With PackageForm.Controls("TBox4") .Enabled = True .Locked = False .BackStyle = fmBackStyleOpaque End With Else With PackageForm.Controls("TBox4") .Enabled = False .Locked = True .BackStyle = fmBackStyleTransparent .Value = "" End With End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Trigger an event on Checkbox change | Excel Programming | |||
Trigger an event on Checkbox change | Excel Programming | |||
Trigger Event | Excel Programming | |||
OnTime event not firing in Workbook_Open event procedure | Excel Programming | |||
Using a checkbox to trigger an email | Excel Programming |