Re: Dynamic Allocation of Events in Word 2003

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.


.



Relevant Pages

  • Re: Listview with checkbox?
    ... > checkboxes) defining them at design time. ... > Shall I roll my own, or is out there something already made that ...
    (borland.public.delphi.thirdpartytools.general)
  • Remove checkbox/control from userform
    ... How do I remove a checkbox that was created at design time from a user form? ... This method deletes any control that was added at ... Or, conversely, must I add all the checkboxes at run-time, if I want to ...
    (microsoft.public.word.vba.userforms)
  • Re: Creating checkbos at runtime!
    ... i pre created controls at design time, i made it invisible at design ... Depends on the textfield value it is displaying the results ... Can u see the gap in between the checkboxes, ...
    (comp.databases.oracle.tools)
  • Listview with checkbox?
    ... I'm after a freeware listview that can host controls(especially checkboxes) defining them at design time. ... Shall I roll my own, or is out there something already made that ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Accessing dynamically created controls from code-behind
    ... reading the value. ... > SQL Server table. ... these checkboxes do not exist at design ... > time and I cannot refer to them in my server-side code at design time. ...
    (microsoft.public.dotnet.framework.aspnet)