Board index » delphi » Synchronizing Forms Question

Synchronizing Forms Question

I have two tables: Client Business Information and Client Personal
Information.  I have created two forms based on each table, frmClientBiz
and frmClientPers.  The common field between the two tables is
Customer_Num.  

frmClientPers is opened from frmClientBiz.  How do I synchronize the two
forms?  For example, if frmClientBiz is showing information on Client #
101, how do I make frmClientPers display information on Client # 101.

Thanks in advance.

Diane Emmich
--
Emmich Computing Service
The Computing Service for Small Business

 

Re:Synchronizing Forms Question


Quote
Diane Emmich wrote:

> I have two tables: Client Business Information and Client Personal
> Information.  I have created two forms based on each table, frmClientBiz
> and frmClientPers.  The common field between the two tables is
> Customer_Num.

> frmClientPers is opened from frmClientBiz.  How do I synchronize the two
> forms?  For example, if frmClientBiz is showing information on Client #
> 101, how do I make frmClientPers display information on Client # 101.

> Thanks in advance.

> Diane Emmich
> --
> Emmich Computing Service
> The Computing Service for Small Business

Here's the trick...

Create a property on the second form called ClientNum...

private
        fClientNum:smallint;
        procedure setClientNum(Value: Smallint);
public
        property clientnum: smallint; read fClientnum write SetClientNum;

procedure tform2.SetClientNum(Value: Smallint);
begin
        fClientNum:=Value; {Update the variable}
        {This is where you synchronize the form to the number passed in.}
end;

---
on the other form use:
Form2.ClientNum:=101; {this will trigger the update.}
--
-----------------------------------------
Software Services - Making Windows Scream
http://www.invsn.com/softserv/
bry...@thevision.net
-----------------------------------------

Other Threads