Using VBA to place a subform on a form.

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

Guest

Hi - Does anyone know if I can use VBA to place a subform on a form and if
so, what the syntax is. eg on form 1, I might want form 2 as the subform or I
might want want form 3 as the subform. Thanks - Jenny
 
Jenny said:
Hi - Does anyone know if I can use VBA to place a subform on a form
and if so, what the syntax is. eg on form 1, I might want form 2 as
the subform or I might want want form 3 as the subform. Thanks - Jenny

You can use VBA to assign the name of the desired form to the
..SourceObject property of the subform control on the main form. For
example,

Me!sfMySubformControl.SourceObject = "Form2"

You may find you have to reset the .LinkMasterFields and
..LinkChildFields properties as well.
 
Hi Dirk - Thanks - I'll give it a try - won't be able to get back to you
before 5/11/05 though. Have a good day! Jenny
 
Back
Top