Programmatic creation of Option Group

  • Thread starter Thread starter Raj
  • Start date Start date
R

Raj

Hi,
I need to create an option group based on a selection
(onclick of a button) in the form. The option group
options and labels (radio value and label) should come
from a query based on the button clickced.

Any help is greatly appreciated.

Thanks
Raj.
 
You can not create a new control on a form, at runtime of that form. So your
only option is, to pre-create a suitable option group control, but make it
invisible at design time or from form_open etc. Then, when the button is
clicked, set the relevant properties of the pre-created control (eg.
controlsource, option captions etc.) then make it visible. You would have to
decide on the maximum number of option buttons to pre-create. You could not
add more options at runtime, just as you can not create the option group
itself at runtime.

HTH,
TC
 
Back
Top