Check box affecting subform

  • Thread starter Thread starter Colin Foster
  • Start date Start date
C

Colin Foster

Sorry for the vague subject!
What I want to be able to do is if a checkbox on my mainform is "ticked",
then I want to restrict the values showing in a lst that is held within a
subform held within the main form. Is this possible?
Regards
Colin Foster
 
Almost everything reasonable is possible :-)
In the subform, you can set the list RowSource property depending on the
value of the checkbox. Reference the checkbox using the Parent property
of the subform:

Me.myList.RowSource = "SELECT F1, F2 FROM myTable "
IF Me.Parent.Form.myCheckbox THEN
Me.myList.RowSource = Me.myList.RowSource & " WHERE F3 = 100"
END IF

Cheers,
Pavel
 
Back
Top