Answer the question
In order to leave comments, you need to log in
How to link tables in ADOQuery in Delphi?
There is no Mastersource property in ADOQuery, how to link three tables? One of them is the main table with the key field Key, and the other two tables are subordinate. Each of these tables has a key field Product.
The action should be like this: for example, the user clicks on a record in table 1, and the data of this record is displayed in table 2
Answer the question
In order to leave comments, you need to log in
For the master table, handle the AfterScroll event, something like this:
Master query
Detail query
procedure TForm1.ADOQuery1AfterScroll(DataSet: TDataSet);
begin
ADOQuery2.Close;
ADOQuery2.Parameters[0].Value := ADOQuery1.FieldByName('id').Value;
ADOQuery2.Open;
end;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question