Greeting All
I have several public variables which I use to build a filter string that I would like to use when I open a form and several associated sub forms. I have set the value of the combo box on one of the subforms with this variable. I have not yet figured a way to have the update event code on the combo box run automatically, so I put the following code in the open statement of the main subform. Here is some current code:
Me.Filter = "[trYear]='" & Me![Combo46] & "'"
Me.FilterOn = True
This code works and populates subform teacherresource s1
Forms!schools1! enrollmentsub.F orm.Filter = "[year]='" & Me![Combo46] & "'"
Forms![schools1]![enrollmentsub].Form.FilterOn = True
This code which is pulled from the update event of the of the combo box located on the teacherresource s1 form and now placed in the open event of teacherresource s1 fails with the following message:
Error 2455 invalid reference to the property form
My question is how to get the combo box to run as the form opens so that all forms are filtered as if I had made the selection from the combo box manually. Thanks for any insight here.
Patti
Tags: ms, access, 2003
I have several public variables which I use to build a filter string that I would like to use when I open a form and several associated sub forms. I have set the value of the combo box on one of the subforms with this variable. I have not yet figured a way to have the update event code on the combo box run automatically, so I put the following code in the open statement of the main subform. Here is some current code:
Me.Filter = "[trYear]='" & Me![Combo46] & "'"
Me.FilterOn = True
This code works and populates subform teacherresource s1
Forms!schools1! enrollmentsub.F orm.Filter = "[year]='" & Me![Combo46] & "'"
Forms![schools1]![enrollmentsub].Form.FilterOn = True
This code which is pulled from the update event of the of the combo box located on the teacherresource s1 form and now placed in the open event of teacherresource s1 fails with the following message:
Error 2455 invalid reference to the property form
My question is how to get the combo box to run as the form opens so that all forms are filtered as if I had made the selection from the combo box manually. Thanks for any insight here.
Patti
Tags: ms, access, 2003
Comment