Vista Software
Tip: Filtering data: SetScope method (Master/Detail)

Filtering data: SetScope method (Master/Detail)

Applies to: Apollo COM, VCL

If you have an available index on a field and wish to apply a "filter" to that field, then instead of TApolloTable's SetFilter, you should use either the Query method or SetScope.

Example:

Customer (master)
Orders (detail) procedure

TForm1.CustomerTableAfterScroll(DataSet: TDataSet);
var
  key : string;
begin
// get the key field that you want to "link" on
key := CustomerTable.FieldByName('CustID').AsString;
// SetScope( LowValue, HighValue )
OrdersTable.SetScope( key , key );
// FYI: SetScope( '', '') to clear the scope
end;

Back
Apollo Database Engines