BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Master Detail Problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (InterBase Express)
View previous topic :: View next topic  
Author Message
MrT
Guest





PostPosted: Fri May 26, 2006 1:14 am    Post subject: Master Detail Problem Reply with quote



Hi:

I have a Master/Detail relation using the master datasource to
synchronize the detail.

The master can be one of two tables. In Master 1 I have a key
field Id and and in Master 2 I use an Id field + "-" + subID field


I open the Form with the detail data set and pass parameters dYear and
MemberID (either the single value or the composite value depending on
Master). Many remaining fields in Detail correspond with fields in both
masters. I had assumed that Field NAMEFIRST in detail would be
automatically supplied with the value from Field NAMEFIRST in the master
via the NAMEFIRST :NAMEFIRST relationship through the data source even
though I am supplying the key field values separately. I have never
tried this before and perhaps is does not work this way.

Manually inserting data for testing through IBConsole allows selection
of correct record from either of the two masters.


select * from CRINVOICE
where YEARINV = :dYear AND ID = :MemberId


When I insert into the detail:

insert into CRINVOICE
(YEARINV, ID, SEQUENCE, ROA_ID, NAMEFIRST, MI, NAMELAST, POBOX,
NUMBER,
STREET, CITY, STATE, ZIP, DPBC_2, DBPC_CHK, INVOICE_NUM,
INVOICE_DATE,
INVOICE_AMT, DUE_DATE, AMOUNT_PAID, DATE_PAID, CHKCSH_PAY,
NUMBER_PAY,
BALANCE_OWING, CURRENT_DUE, AMT00TO30_DUE, AMT31TO60_DUE,
AMT61TO90_DUE,
AMTOVER90_DUE, INVOICE_DETAIL)
values
(:dYEAR, :MemberID, :SEQUENCE, :ROA_ID, :NAMEFIRST, :MI, :NAMELAST,
:POBOX,
:NUMBER, :STREET, :CITY, :STATE, :ZIP, :DPBC_2, :DBPC_CHK,
:INVOICE_NUM,
:INVOICE_DATE, :INVOICE_AMT, :DUE_DATE, :AMOUNT_PAID, :DATE_PAID,
:CHKCSH_PAY,
:NUMBER_PAY, :BALANCE_OWING, :CURRENT_DUE, :AMT00TO30_DUE,
:AMT31TO60_DUE,
:AMT61TO90_DUE, :AMTOVER90_DUE, :INVOICE_DETAIL)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (InterBase Express) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.