Reference a Property of a Subform

  • Thread starter Thread starter David Groome
  • Start date Start date
D

David Groome

I have a form named frmYearly, that has 12 subform controls, whose names are
subctlMonthly_01 thru subctlMonthly_12. The SourceObject for each of these
controls initially defined, and is the same, a subform named fsubMonthly.

I want to set the filter for each of subforms with a slightly different
value: for the first it will be "[CHECK] = '02200501'", the second, "[CHECK]
= '02200502'", and so forth.

How do I reference the Filter property of fsubMonthly subform in the 12
different subform controls? Assume the focus is with frmYearly.

I've read the KB articles Q113352 and 209099 on "How to Refer to a Control
on a Subform or Subreport" but none of their formats seem to cover this
case.


David
 
I assume that you cannot put a criterion expression in the query that is the
subform's RecordSource? That would be a preferred method.

Otherwise, your syntax would be something like this:

Me.subctlMonthly_01.Form.Filter = "[CHECK] = '02200501'"
Me.subctlMonthly_01.Form.FilterOn = True
 
Thanks greatly. I had same syntax, but with the "form" before the control,
not after. Changed it, and worked!

Dave Groome

Ken Snell said:
I assume that you cannot put a criterion expression in the query that is
the subform's RecordSource? That would be a preferred method.

Otherwise, your syntax would be something like this:

Me.subctlMonthly_01.Form.Filter = "[CHECK] = '02200501'"
Me.subctlMonthly_01.Form.FilterOn = True

--

Ken Snell
<MS ACCESS MVP>


David Groome said:
I have a form named frmYearly, that has 12 subform controls, whose names
are subctlMonthly_01 thru subctlMonthly_12. The SourceObject for each of
these controls initially defined, and is the same, a subform named
fsubMonthly.

I want to set the filter for each of subforms with a slightly different
value: for the first it will be "[CHECK] = '02200501'", the second,
"[CHECK] = '02200502'", and so forth.

How do I reference the Filter property of fsubMonthly subform in the 12
different subform controls? Assume the focus is with frmYearly.

I've read the KB articles Q113352 and 209099 on "How to Refer to a
Control on a Subform or Subreport" but none of their formats seem to
cover this case.


David
 
Back
Top