CharlieT302
Instructor
Hi Folks,
I have a main form with two levels of subforms.
Main form
Subform1 (Begindate, Enddate) (Command Button)
Subform2 (Entrydate)
On Subform1, I have two unbound controls (Begindate, Enddate) used to store a filtering date. The EntryDate field on subform2 should show only those dates within the filtering range. The filter is triggered with a command button on subform1. I think I have a syntax error.
Current Filter:
stLinkCriteria = "Forms![frm Meal Orders]!frm_Meals_Schedule.Form!frm_Meals_Schedule_Mainsub.Form!Entry_date>=#" & Me!BeginDate & "# and forms![frm Meal Orders]!frm_Meals_Schedule.Form!frm_Meals_Schedule_Mainsub.Form!Entry_date<= #" & Me!EndDate & "#"
Forms![frm Meal Orders]!frm_Meals_Schedule.Form!frm_Meals_Schedule_Mainsub.Form.Filter = stLinkCriteria
Forms![frm Meal Orders]!frm_Meals_Schedule.Form!frm_Meals_Schedule_Mainsub.Form.FilterOn = True
Also, since this is code on subform1 referring to subform2, can this code be simplified?
I have a main form with two levels of subforms.
Main form
Subform1 (Begindate, Enddate) (Command Button)
Subform2 (Entrydate)
On Subform1, I have two unbound controls (Begindate, Enddate) used to store a filtering date. The EntryDate field on subform2 should show only those dates within the filtering range. The filter is triggered with a command button on subform1. I think I have a syntax error.
Current Filter:
stLinkCriteria = "Forms![frm Meal Orders]!frm_Meals_Schedule.Form!frm_Meals_Schedule_Mainsub.Form!Entry_date>=#" & Me!BeginDate & "# and forms![frm Meal Orders]!frm_Meals_Schedule.Form!frm_Meals_Schedule_Mainsub.Form!Entry_date<= #" & Me!EndDate & "#"
Forms![frm Meal Orders]!frm_Meals_Schedule.Form!frm_Meals_Schedule_Mainsub.Form.Filter = stLinkCriteria
Forms![frm Meal Orders]!frm_Meals_Schedule.Form!frm_Meals_Schedule_Mainsub.Form.FilterOn = True
Also, since this is code on subform1 referring to subform2, can this code be simplified?