Subject Multi-Master/Keysources
Author Daniel Miller
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?

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]