I have a parent form with two subforms
Subform A - frmFilteredLeads in this example is a datasheet view. When I select a record in that form it filters and displays the details of the record in subform b - frmLeadsSubForm.
I have put the following code to the OnCurrent event of frmFilteredLeads.
However, when I open the parent form I get the error message:
If i click end on this error message, the form loads and the filtering works fine.
I have tried putting the above code on the OnLoad event of the parent form and the error message doesnt appear but then the filtering doesnt work.
Subform A - frmFilteredLeads in this example is a datasheet view. When I select a record in that form it filters and displays the details of the record in subform b - frmLeadsSubForm.
I have put the following code to the OnCurrent event of frmFilteredLeads.
Code:
Forms!frmLeads![frmLeadsSubForm].Form.Filter = "[LeadID] = '" & Me.LeadID & "'"
Forms!frmLeads![frmLeadsSubForm].Form.FilterOn = True
However, when I open the parent form I get the error message:
Code:
You entered an expression that has an invalid reference to the property Form/Report
If i click end on this error message, the form loads and the filtering works fine.
I have tried putting the above code on the OnLoad event of the parent form and the error message doesnt appear but then the filtering doesnt work.