This has always bugged me to what is the best way to do the following...
with a simple one to many db, when you have 2 tables/grids on a form and the 2nd one filtered by the first.
where is the best place to put the filter code
ie:
procedure TForm1.tblCustormersAfterScroll(DataSet: TDataSet);
begin
if tblCustormersCustormerID.AsString <> '' then
begin
tblCustormersThings.Filter := 'CustormerID = ' + tblCustormersCustormerID.AsString;
tblCustormersThings.Filtered := true;
end;
end;
AfterScroll seems to work most of the time, but donst get fired on some events eg after posting. Normally i would have a procedure to do the filter update and put it where ever it seems to be needed.
But i was wondering if there is a better way, this seems like simply stuff delphi should know about...
I Dont think it matters but im Using Delphi7 and NexusDB1