CharlieT302
Instructor
Hi Folks,
I have a form with two levels of subforms. From the main form, I have code on the "On Load" event, which filters the nested subform. This worked fine when I only had one subform. Adding the nested subform is causing problems. Obviously, my syntax is wrong, but I am not seeing it.
Main form
Subform
Nested Subform
Current Syntax:
Forms![frm Meal Orders]![frm_Meals_Schedule].Form!frm_Meals_Schedule_Mainsub.Form.Filter = "Year([entry_date]) = Year(date())"
Forms![frm Meal Orders]![frm_Meals_Schedule].Form!frm_Meals_Schedule_Mainsub.Form.FilterOn = True
Forms![frm Meal Orders].[frm_Meals_Schedule].Form.YearOn.Value = "Current"
By the way, the reason for placing the code on the main form was to allow the filter to remain in place on the nested subform as I move between records. The main form lists individuals, while the nested subform list activity for the individuals.
Ideas?
I have a form with two levels of subforms. From the main form, I have code on the "On Load" event, which filters the nested subform. This worked fine when I only had one subform. Adding the nested subform is causing problems. Obviously, my syntax is wrong, but I am not seeing it.
Main form
Subform
Nested Subform
Current Syntax:
Forms![frm Meal Orders]![frm_Meals_Schedule].Form!frm_Meals_Schedule_Mainsub.Form.Filter = "Year([entry_date]) = Year(date())"
Forms![frm Meal Orders]![frm_Meals_Schedule].Form!frm_Meals_Schedule_Mainsub.Form.FilterOn = True
Forms![frm Meal Orders].[frm_Meals_Schedule].Form.YearOn.Value = "Current"
By the way, the reason for placing the code on the main form was to allow the filter to remain in place on the nested subform as I move between records. The main form lists individuals, while the nested subform list activity for the individuals.
Ideas?