Usuario Anónimo wrote: > I have three TDBGrids. > > Phone has two foreigns keys: Contact and Company. >
The automatic master/source relationship provided by MasterSource property will not work in this case. You will need to do manually. - Clear the MasterSource/IndexFieldNames properties - Create a procedure UpdatePhone and put PhoneDataset.Sql := 'Select * from PhoneTable where Contact = ' + ContactDataset.FieldByName('IdField').AsString + ' And ' + 'Company = ' + ContactDataset.FieldByName('IdField').AsString; PhoneDataset.Close; PhoneDataset.Open; - Call UpdatePhone inside OnAfterScroll events of ContactDataset and CompanyDataset Some refinement may be needed to handle corner cases (no contact etc) Luiz _______________________________________________ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus