Insert a Subform at Runtime

D

dchman

Is it possible to insert a subform into a form at runtime? I've figured out
how to create a new subform and build it from scratch, but I'd prefer just to
insert an already created subform.

Thanks for any help you can provide.
 
D

dchman

thanks for the quick response. Why I want to do this is a long story -
suffice it to say that it seems to be the best way to do what the client
wants. Your suggestion to use the SourceObject is something I had overlooked
and works fine (Access is not my usual development environment). Thanks again
 
T

TKO

I found that creating subforms with modules at run time is useful because I
can create the forms on the fly at run time and attach as subform, this saves
alot of development and maintenance effort as I would have had to create
dozens of forms, and modify every time a field name changed or is added or
deleted from the associated table. It gets used once at runtime and then is
distroyed.
 
T

TKO

Also, this makes it possible for the end user to add or remove controls from
the form/sub forms, with modules, on their own, at run time, without knowing
any thing about the IDE or writing source code.
 
Top