Subject | Re: [IBO] Design question about master (master?) detail relation |
---|---|
Author | Jason Wharton |
Post date | 2001-04-12T16:32:50Z |
What you need to do in this situation is chose which master will be used via
the MasterSource and MasterLinks properties and then the other one you will
need to manually do by adding input parameters to the SELECT statement
somewhere (presumably in your where clause).
Then, use a datasource for the alternate master dataset and in its
OnDataChange event do an
yDetailDataset.ParamByName( 'ACOL' ).Assign( AltMaster.FieldByName( 'ACOL' )
)
This will effectively give you what you need. Using Assign( ) will avoid it
doing a refresh unless the value actually changes.
Be sure the detail is setup to do RefreshOnParamChange
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
the MasterSource and MasterLinks properties and then the other one you will
need to manually do by adding input parameters to the SELECT statement
somewhere (presumably in your where clause).
Then, use a datasource for the alternate master dataset and in its
OnDataChange event do an
yDetailDataset.ParamByName( 'ACOL' ).Assign( AltMaster.FieldByName( 'ACOL' )
)
This will effectively give you what you need. Using Assign( ) will avoid it
doing a refresh unless the value actually changes.
Be sure the detail is setup to do RefreshOnParamChange
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
----- Original Message -----
From: <mmenaz@...>
To: <IBObjects@yahoogroups.com>
Sent: Thursday, April 12, 2001 7:17 AM
Subject: [IBO] Design question about master (master?) detail relation
Hi, I've 3 tables, A that is sure the master one, B that is detail
respect to A, and C that is a detail for the A and B current row,
i.e.
the A+B primary key are the foreign key for the C detail table.
Since the TIB_Query has only one possible reference for a master
datasource, what is the best way, eventually better code location,
for
solving this problem?
Think something like:
A customer table
B logical places (i.e. home, office, parents, mobile)
C telephone numbers
So Mary at home has 3 rows of telephone numbers
Mary at office has 2 numbers
Mary has one mobile phone number
C (mary) B C
|----------- home -------800 2554444
| |----------750 0045444
| |----------544 4445454
|
|----------- office -----450 5554444
| |----------754 0455554
|
|---------- mobile ------477 5554444
So in the first IB_Grid I select Mary, then in the second I select
office, and the 3° shows me her office telephone numbers...
Thanks
Marco Menardi
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/