Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting the Form Filter property

Status
Not open for further replies.

CharlieT302

Instructor
Mar 17, 2005
406
US
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?
 
Make sure you are using the subform CONTROL name and not the subform name (if they are different).


Bob Larson
A2K,A2K3,A2K7,SQL Server 2000/2005,Crystal Reports 10/XI,VB6, WinXP, and Vista
Free Quick Tutorials and Samples:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top