Example: MasterSource, MasterFields

Top Previous Next

Suppose you have a master table named Customer that contains a CustNo field, and you also have a detail table named Orders that also has a CustNo field.

To display only those records in Orders that have the same CustNo value as the current record in Customer, write this code:

Orders.MasterSource := 'CustSource';
Orders.MasterFields := 'CustNo';

If you want to display only the records in the detail table that match more than one field value in the master table, specify each field and separate them with a semicolon.

Orders.MasterFields := 'CustNo;SaleDate';