Board index » delphi » Master-Detail Table Link lose problem

Master-Detail Table Link lose problem

Hello Everbody,

my problem :

when tables disablecontrols and tables in loop child table's link is being
lose

example:
--------------------------------------------------------
  tblMaster.disableControls;
  tblDetail.disableControls;

  tblmaster.first;
  while not tblmaster.eof do
  begin
    tblDetail.first;
    while not tblDetail.eof do
    begin
      showmessage(tblMaster.fieldbyname(linkfieldname).asstring +
        '-' + tblDetail.fieldbyname(linkfieldname).asstring;
        {when tables.enablecontrols loop working true but when
tables.disablecontrols loop working false}
        tblDetail.next;
    end;
    tblMaster.next;
  end;
----------------------------------------------------------
my result : when tables.disablecontrols, table linking(detail table) not
working it's a true?

Any idea

Faruk

 

Re:Master-Detail Table Link lose problem


Yes, disable controls disables the datasource link, so if you are using the
mastersource property, the child will not get updated.  You could do a set
range on the child table after you move one record in your parent table

-Gabe

Quote
Faruk Gunes wrote:
> Hello Everbody,

> my problem :

> when tables disablecontrols and tables in loop child table's link is being
> lose

> example:
> --------------------------------------------------------
>   tblMaster.disableControls;
>   tblDetail.disableControls;

>   tblmaster.first;
>   while not tblmaster.eof do
>   begin
>     tblDetail.first;
>     while not tblDetail.eof do
>     begin
>       showmessage(tblMaster.fieldbyname(linkfieldname).asstring +
>         '-' + tblDetail.fieldbyname(linkfieldname).asstring;
>         {when tables.enablecontrols loop working true but when
> tables.disablecontrols loop working false}
>         tblDetail.next;
>     end;
>     tblMaster.next;
>   end;
> ----------------------------------------------------------
> my result : when tables.disablecontrols, table linking(detail table) not
> working it's a true?

> Any idea

> Faruk

Other Threads