Hi,
When you define a master-detail relationship between two datasets (tables, in
your case), the detail dataset is filtered according to relationship field with
master dataset. When you create a new record in detail dataset, please check if
you are setting the value of this relation field according to current record in
Master dataset.
E.g.
OnNewRecord of detail u can mention
TDetail.FindField('TNo').AsString := TMaster.FindField('TNo').AsString;
HTH,
regards,
Vishak
----------------------------------------------------
----- Original Message -----
From: Alex Oentoro
To: [email protected]
Sent: Tuesday, February 06, 2007 9:44 AM
Subject: [delphi-en] problem about ADOTable+Grid
Hi,
i have a question about master-detail connection using TADOTable & Grid
I put 2 ADOTable in 1 form :
TMaster : Primary Key : TNo
TNo char(10)
TTgl date
TCust char (25)
TDetail : Primary Key : TNo, TUrut
TNo char(10)
TUrut byte
TBarang char(25)
THrg integer
TQty integer
TSubTot integer
TMaster & TDetail connected via MasterSource property of TDetail
each table connected to separate Grid
the Problem occurs on the detail grid. Everytime I enter more than 1
row, detail for the previous row become disappear. But after the
Transaction is saved, all data rows suddenly appear.
eq : I enter 1 row on detail, and then press down key to enter data
for 2nd row on the grid ... then 1st row is disappear. Same thing
happened when I press down once more to enter the 3rd data, so at one
time there is only 1 row appear in the detail grid
what should I do to make all rows always appear when I enter more than
1 row of data ?
thx in advance.
**************** CAUTION - Disclaimer ******************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are
not to copy, disclose, or distribute this e-mail or its contents to any other
person and any such actions are unlawful. This e-mail may contain viruses. Agni
has taken every reasonable precaution to minimize this risk, but is not liable
for any damage you may sustain as a result of any virus in this e-mail. You
should carry out your own virus checks before opening the e-mail or attachment.
Agni reserves the right to monitor and review the content of all messages sent
to or from this e-mail address. Messages sent to or from this e-mail address
may be stored on the Agni e-mail system. ***Agni Software Pvt. Ltd.
******************* End of Disclaimer *********************
[Non-text portions of this message have been removed]