Subject Master-Detail Trouble
Author Craig Cox
I have set up hundreds of M-D relationships in Delphi, but this one won't seem to give up. Any help would be greatly appreciated.

Delphi XE, FB 1.5, IBO - TIBOTables

My master table is SALES with a primary key called SALES_PK My detail table is called SALES_DETAILS with a column called SALES_PK that will hold the values from the master.

I set up the relationship in the object inspector. It acts a little strange - no dialog to assist with the set up (not sure this is provided for TIBOTables. So I pick the MasterTable, but I have to type in the MasterFields value as SALES_PK.

When I run the program, I enter a new sale and post the record. A generator provides the new SALES_PK value as expected. I then open a new form to enter the details, but SALES_DETAILS grabs SALES_PK from the first record of the SALES table and not the one I just entered.