WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

No Events for Dynamically Created Checkboxes?

 
   Home -> Office -> User Forms RSS
Next:  User Forms: Data validation form dynamically created textboxes  
Author Message
edamron

External


Since: May 08, 2008
Posts: 5



(Msg. 1) Posted: Wed Jun 25, 2008 9:35 am
Post subject: No Events for Dynamically Created Checkboxes? Add to elertz
Archived from groups: microsoft>public>word>vba>userforms (more info?)

I get the error: "Object does not source automation events" when I
dynamically create a checkbox withevents.

i.e. Inside a class object I have:
Private WithEvents ochkInjury As CheckBox

This throws the described exception.

Is there anyway to know when a dynamically created checkbox is set/
reset (at the time the user clicks on it.) so that I can set/reset the
visibility of other dynamically created controls on the form?

Thanks.
Back to top
Login to vote
edamron

External


Since: May 08, 2008
Posts: 5



(Msg. 2) Posted: Wed Jun 25, 2008 11:58 am
Post subject: Re: No Events for Dynamically Created Checkboxes? Add to elertz [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Jun 25, 11:24 am, "Jonathan West" <jw....TakeThisOut@mvps.org> wrote:
> "edamron" <edam....TakeThisOut@spamcop.net> wrote in message
>
> news:9d4dfb2c-18f2-4397-8da2-ef6350fb31be@r66g2000hsg.googlegroups.com...
>
> >I get the error: "Object does not source automation events" when I
> > dynamically create a checkbox withevents.
>
> > i.e. Inside a class object I have:
> > Private WithEvents ochkInjury As CheckBox
>
> > This throws the described exception.
>
> > Is there anyway to know when a dynamically created checkbox is set/
> > reset (at the time the user clicks on it.) so that I can set/reset the
> > visibility of other dynamically created controls on the form?
>
> I think what you are trying to do is impossible
>
> Instead, what you can do is have a checkbox created at design time, and turn
> its Visible property on & off to give the impression of being dynamically
> created.
>
> --
> Regards
> Jonathan West - Word MVPwww.intelligentdocuments.co.uk
> Please reply to the newsgroup

Unfortunately I can't do that but I think I found a work around. I
can use a dynamically created option button which does expose the
click event and with some extra coding I can make it act like a
checkbox. A little on the retarded side but I'm getting use to that
with VBA and dynamically created controls. Smile
Back to top
Login to vote
Jonathan West

External


Since: Dec 18, 2003
Posts: 141



(Msg. 3) Posted: Wed Jun 25, 2008 7:24 pm
Post subject: Re: No Events for Dynamically Created Checkboxes? Add to elertz [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"edamron" <edamron.RemoveThis@spamcop.net> wrote in message
news:9d4dfb2c-18f2-4397-8da2-ef6350fb31be@r66g2000hsg.googlegroups.com...
>I get the error: "Object does not source automation events" when I
> dynamically create a checkbox withevents.
>
> i.e. Inside a class object I have:
> Private WithEvents ochkInjury As CheckBox
>
> This throws the described exception.
>
> Is there anyway to know when a dynamically created checkbox is set/
> reset (at the time the user clicks on it.) so that I can set/reset the
> visibility of other dynamically created controls on the form?

I think what you are trying to do is impossible

Instead, what you can do is have a checkbox created at design time, and turn
its Visible property on & off to give the impression of being dynamically
created.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> User Forms All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET