Subject Re: [IBO] Multi-Master/Keysources
Author Helen Borrie
At 11:31 AM 23-07-01 -0700, you wrote:
>I'm trying to implement a lookup relationship. I have a screen with two grid components, one master and one detail. In addition, the grid components have combo boxes. The master/detail relationships work fine between the grids, and the master combo boxes work as well. The problem is the detail combo box. I want to limit the choices of the combo box based on the selected master record. I've set the keysource, mastersource, keylink, keydesclink, and masterlink properties. When I attempt to change records in the master, I receive an "Unable to scroll dataset" error. If I delete either the keysource or mastersource properties of the detail combo box, the program runs (of course, without the proper functionality). Originally, I tied the mastersource to a source/field combination of the master grid's combo box. I'm now trying to tie to the grid source directly. Ideas?

Daniel,

If the information supplied below is correct, it looks as if you have your relationships scrambled.

The master-detail relationship is Purchase_Orders ~ PO_Parts. MasterSource on PO_Parts should be the datasource for Purchase_Orders and MasterLinks, also on PO_Parts, should be:

PO_ID=Purchase_Orders.PO_ID

The lookup relationship is PO_Parts ~ Vendor_Parts. KeySource on Vendor_Parts should be the datasource for PO_Parts and KeyLinks, also on Vendor_Parts, should be

Vendor_Part_ID=Vendor_Parts.Vendor_Part_ID

KeyDescLinks for this relationship should be

Vendor_Part_No=PO_Parts.VP_VENDOR_PART_NO


Regards



>Simplified Tables:
>
>Purchase_Orders
>PO_NO
>VENDOR_ID
>
>Vendors
>VENDOR_ID
>
>Vendor_Parts
>VENDOR_PART_ID
>VENDOR_ID
>VENDOR_PART_NO
>
>PO_Parts
>PO_PART_ID
>PO_ID
>VENDOR_PART_ID
>
>Given the above tables, the problem query is the Vendor_Parts combo lookup inside the PO_Parts grid. I define it as:
>SELECT VENDOR_PART_ID
> , VENDOR_PART_NO
> , VENDOR_ID
>FROM VENDOR_PARTS
>
>KeySource: PO_Parts
>KeyLink: VENDOR_PARTS.VENDOR_PART_ID=PO_PARTS.VENDOR_PART_ID
>KeyDescLink: VENDOR_PARTS.VENDOR_PART_NO=VP_VENDOR_PART_NO
>/* VP_VENDOR_PART_NO is defined as a singleton select in the PO_Parts query for the grid */
>MasterLinks: VENDOR_PARTS.VENDOR_ID=PURCHASE_ORDERS.VENDOR_ID
>MasterSource: Purchase_Orders
>
>Daniel
>
>
>[Non-text portions of this message have been removed]
>
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________