How can I create a subform programmatically (ie dynamically - not.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm new to Access and VB - I need to create a subform 'on the fly' (ie in
code) depending on the contents of my main form. I understand that I need a
control and a SubForm form type. How do I proceed please?
Cheers,
jim
 
It is much better to create the subform in design view, and then make it
visible/invisible as needed by code. An ACCESS form can have only 754
controls created during its life; if you create and delete subforms by code,
you'll likely run into this problem and then the code will stop working.

You can change, using VBA code, the source object of the subform control,
the recordsource of the source object, the properties of the subform
control, etc.
 
Hi Ken - Thanks a million - that's very helpful - will do as you say. Thanks
for such a prompt and informative reply
 
Back
Top