Subform link

I have a form and a subform on it. The subform table has a primary key combined from two fields. So in SubFormLink I need to define two relations. The first value comes from field in main form, that’s OK, the second one is in a variable (the variable gets its value from some setup record). How to force the table filter to get the value from variable, when only CONST, FIELD, FILTER is valid. Shoud I create a dummy field with the same value for all records to get the things work? Or is there a way to “preset” the table filter before the subform link is used?

Link the subform only with one parameter, the PK of the main form. On Subform.OnOpenform you can use read the setup-record and perform a FILTERGROUP command so the filters from the setup-record might not be deleted by the user: OnOpenForm Begin SetupRecord.GET; FILTERGROUP(2); SubRecord.Setrange(PKField2,SetupRecord.FilterValue); FILTERGROUP(0); End; Marcus Fabian ---------------------------------- 079 439 78 72 ----------------------------------

Thanks, It works!