How to respond event for a control that created by VBA during runtime?

  • Thread starter Thread starter bruce
  • Start date Start date
B

bruce

dear all:
If I create a control by VBA during runtime, for example ObjectFrame,
how can I code to respond the event gave out by the control?
Thanks for look over it!
 
bruce said:
dear all:
If I create a control by VBA during runtime, for example ObjectFrame,
how can I code to respond the event gave out by the control?
Thanks for look over it!

As a matter of interest, what are the circumstances that dictate you need to
create a Control by VBA at runtime? I ask because I have been developing
Access applications since 1993, and have never encountered any problem whose
solution required doing so.

Larry Linson
Microsoft Access MVP
 
to Larry

Haha, I want to do this because I don't know the exact number of
options for a question. If someone need input more option tips, I can
create a objectFrame control for him, dynamically.
 
If you want to use an Option Group, you'd be best off selecting a maximum
possible number of options, adding all of those options to the form, and
simply controlling the visibility of the unnecessary ones for each question.

Otherwise, using a subform that contains the options, or a listbox would
probably be a better idea for unknown options.
 
To Steele:

Thanks for you help, and I am now working just like that you suggested!
But later, maybe I still need to use the dynamic mathod for I don't
know the potential amount of options, twenty? thirty?. I do not useing
listbox just because the options are not text only, sometime figures,
and formula. So I need using word document object to treat it.
 

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