how to access programatically added controls

  • Thread starter Thread starter don bowyer
  • Start date Start date
D

don bowyer

I have a UF to which some code adds a CommandButton in
runtime. No problem. But in design mode, by defenition,
the added control doesn't exist. So where do I put code to
recognise and act upon its click event. I've run out of
inspired guesses. Any help would be appreciated.
Don
 
John Walkenbach has an example using OptionButtons at:
http://j-walk.com/ss/excel/tips/tip76.htm

But as an alternative, couldn't you design your form with that button already on
there--just have it not visible. Then when/if you need it, show it. (seems
much easier to me).
 
Don,

Might be easier to add the control and its code during design and set the visible property to false.
Then when you want to use the control, set its visible property to true.

Regards,
Jim Cone
San Francisco, CA
 
Thanks to both Dave & Jim. That is the conclusion I came
to - keep it simple! I will look at John's site for
OptionButtons though. Cheers
Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top