A
AlexT
Folks
I am trying to develop a semi generic form that I fine tune at runtime.
I other words I have a form called frmGeneric. When relevant I
instantiate a new form based on frmGeneric and, before making it
visible, I setup some properties (such as fields names, record source,
etc) at run time.
This works great so far but I am having a problem with a subForm
embedded into the main form. As per my above strategy, I will have to
access the subForm controls before displaying it... But how should I
reference those controls ?
Say lstObj is my subform, from the container form code module in the
LOAD envent I would be tempted to use
Me.lstObj.Form.Controls(aCtl).Caption = "something"
where aCtl is the name of a control in the sub form
But this fails...
(The expression you entered refers to an object that is closed or
doesn't exist.)
It's probably trivial but I can't seem to find the "right way"
of doing this
Any help welcome
I am trying to develop a semi generic form that I fine tune at runtime.
I other words I have a form called frmGeneric. When relevant I
instantiate a new form based on frmGeneric and, before making it
visible, I setup some properties (such as fields names, record source,
etc) at run time.
This works great so far but I am having a problem with a subForm
embedded into the main form. As per my above strategy, I will have to
access the subForm controls before displaying it... But how should I
reference those controls ?
Say lstObj is my subform, from the container form code module in the
LOAD envent I would be tempted to use
Me.lstObj.Form.Controls(aCtl).Caption = "something"
where aCtl is the name of a control in the sub form
But this fails...
(The expression you entered refers to an object that is closed or
doesn't exist.)
It's probably trivial but I can't seem to find the "right way"
of doing this
Any help welcome