Dynamic relationship to subform ?

Hi How we can put relationships to subform while runtime ? Regards Joseph Mathew

If the relationship does not depend on the record selected on the main form then you can set filters on the OnOpenForm trigger of the subform. If the relationship does depend on the record selected on the main form then you can define a function on the subform that sets filters based upon parameters passed to it and call this function from the OnAfterGetCurrRecord trigger of the main form. If the relationship depends upon some values set on the main form you will also need to call this function as part of the OnAfterValidate trigger for those controls. In either case I would use the appropriate non-zero filtergroup so that the user can not change these filters.