problems wit a lookup ?

hi,everybody i have the following problem : i am in a form ,lets say form A, and on that form is a textbox (Filter) who has a table relation with the table Phase. there is also a tablebox on the form A containing the records from variantLine table. if i push on the lookup button of Filter then a modal form comes up showing the phase records.If i now choose one from the modal form (phase records) then the records in the tablebox have to be filtered on that one. Now I have programmed the following triggers in my form A: OnValidate() Mgt.SetFilter(Rec,Filter); //Mgt = codeunit //Rec = tablebox records OnAfterValidate() CurrForm.UPDATE; OnLookup(VAR Text : Text[1024]:wink: : Boolean recPhase.SETRANGE(“Project Code”,Rec.JobNo); IF FORM.RUNMODAL(FORM::Phases,recPhase)= ACTION::LookupOK THEN BEGIN Filter := recPhase.Code; END; Mgt.SetFilter(Rec,Filter); //codeunit mgt : SetFilter(VAR VL : Record VariantLine;Filter : Text[1024]) VL.SETFILTER(“Phase code”,Filter); now when i use the validate trigger of Filter then everythings gets perfectly filtered but when i use the lookup trigger then they all get filtered except for the one the record pointer in tablebox is pointing at. how is this possible ? is there anybody who can sort this mess out ? Best regards, Naessens Wendy.

Hi! Try this: OnLookup(VAR Text : Text[1024]:wink: : Boolean recPhase.SETRANGE(“Project Code”,Rec.JobNo); IF FORM.RUNMODAL(FORM::Phases,recPhase)= ACTION::LookupOK THEN BEGIN Filter := recPhase.Code; Mgt.SetFilter(Rec,Filter); END; IF Filter is a field in the table then you can also do: OnLookup(VAR Text : Text[1024]:wink: : Boolean recPhase.SETRANGE(“Project Code”,Rec.JobNo); IF FORM.RUNMODAL(FORM::Phases,recPhase)= ACTION::LookupOK THEN BEGIN Record.VALIDATE(Filter,recPhase.Code); END; Greets