Re: Dynamic Allocation of Events in Word 2003
- From: "Tony Jollans" <No Mail>
- Date: Thu, 13 Oct 2005 18:31:45 +0100
It should work and it is relatively straightforward if you are able to set
up the code at design time.
If you put the routines in the Userform's Class module and you name them
correctly you shouldn't have to do any more. It might be worth explicitly
naming your checkboxes ...
Controls.Add("Forms.CheckBox.1", "CheckBox1", True)
... but, other than that I don't know what to suggest.
--
Enjoy,
Tony
"Phil Gurr" <PhilGurr@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E6658138-AA07-486F-A74A-BEBD913AC080@xxxxxxxxxxxxxxxx
> Hello, I'm writing a VBA app in Word 2003 where CheckBoxes are dynamically
> added to a form based on details held in an Access Database...
>
> .Controls.Add("Forms.CheckBox.1", , True)
>
> I want to be able to perform some validation when any of the CheckBoxes
are
> turned on or off but am not sure how to atatch the CheckBox Change event
to
> the actual CheckBox(s) at run-time. I've tried setting up several "Private
> Sub CheckBox#_Change()" subroutines (where # is 1 to 9) at design-time,
but
> (not surprisingly) it didn't work.
>
> Any suggestions would be welcome.
>
> Thanks,
> Phil.
.
- References:
- Dynamic Allocation of Events in Word 2003
- From: Phil Gurr
- Dynamic Allocation of Events in Word 2003
- Prev by Date: Dynamic Allocation of Events in Word 2003
- Next by Date: Re: References for VBA
- Previous by thread: Dynamic Allocation of Events in Word 2003
- Next by thread: Help! Object Variable or With Block variable not set
- Index(es):
Relevant Pages
|