G
Guest
I’m having some difficulty manipulating controls on a subform. Here is the
setup:
- The parent form is called frmMain. It has a frame on it called subFrame
where the subform resides. The frame is not bound in the properties but its
SourceObject is set in code because several subforms use the same frame.
- The subform in question is called fsubStatEntry. It has many controls,
but among those I want to manipulate are a label called lblMetricScore and a
text box called txtMetricScore. The query that fsubStatEntry is based on is
called qryStatistics.
The plan is that when certain events take place, the caption of
lblMetricScore would be changed and the source of txtMetricScore would be
changed to a different field from the underlying query. I can get this to
work fine when using the code such as me.txtMetricScore.ControlSource = “QAâ€
on the fsubStatEntry directly. However, because there are several different
events that can trigger this and there are many different possible changes to
each control, I am trying to put all the code into a module. Using “me.â€
obviously doesn’t work from the module, because the controls aren’t part of
the module’s “me†object. Can anyone explain what the code needs to look
like when fired from the module? I have tried a number of different ways but
haven’t been able to come up with a functional code string.
setup:
- The parent form is called frmMain. It has a frame on it called subFrame
where the subform resides. The frame is not bound in the properties but its
SourceObject is set in code because several subforms use the same frame.
- The subform in question is called fsubStatEntry. It has many controls,
but among those I want to manipulate are a label called lblMetricScore and a
text box called txtMetricScore. The query that fsubStatEntry is based on is
called qryStatistics.
The plan is that when certain events take place, the caption of
lblMetricScore would be changed and the source of txtMetricScore would be
changed to a different field from the underlying query. I can get this to
work fine when using the code such as me.txtMetricScore.ControlSource = “QAâ€
on the fsubStatEntry directly. However, because there are several different
events that can trigger this and there are many different possible changes to
each control, I am trying to put all the code into a module. Using “me.â€
obviously doesn’t work from the module, because the controls aren’t part of
the module’s “me†object. Can anyone explain what the code needs to look
like when fired from the module? I have tried a number of different ways but
haven’t been able to come up with a functional code string.