(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?
(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.
(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.
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