Example of 'Set Filter To' with a run-time user defined dBase expression filter:

{The first line demonstrates also the bilingual "activity" on displaying a modal form}

form2.label1.caption := IIF(Language='F','Entrez l''expression du filtre','Enter Filter Expression');

form2.showmodal;
if form2.modalresult = mrOK then


Begin
    FilterKey := Form2.Edit1.text;
    ShowMsg(IIF(Language='F','Filtrage, patience...','Filtering. Please wait...'));
    TzDbf1.DisableControls;
    SaveRecNo := TzDbf1.RecNo; { integer }
    FilterKey := Trim(FilterKey);
    if (FilterKey = '')  then   TzDbf1.SetFilterTo('')
   else TzDbf1.SetFilterTo(FilterKey);

  TzDbf1.Go(SaveRecNo);

End;                                                                      Back to Developer's page