|Subject||Re: [IBO] Keysource & Master Relationships Problem|
> I hope you can see how the cross-linked relationships are causing thisBooking,
> snafu. Applying values to ticket from the selected Booking row is no
> problem. If there is a forced 1:1 relationship between Lading and
> as seems apparent, then don't Keylink Lading to Ticket. Put it in a ComboI don't *exactly* see how they're causing my problems, though I do see that
> (not a LookupCombo) and use it as a selector for a Booking structure which
> joins Lading and Booking and supplies the values to Ticket. You can then
> masterlink this joined structure to Ticket through its Lading_ID.
I have a confusing setup. How about this: I've eliminated the M/D between
Lading and Booking and replaced it with a join (see below). I left the
LookupCombo attached between Ticket and Lading/Booking (tied on LADING_ID)
so the user can select a Lading (and its associated Booking).
FROM LADING L JOIN BOOKING B
ON L.BOOK_ID = B.BOOK_ID
This works fine except for one thing, and that's the part I don't
understand. This works as long as I do not have the assignment between
Booking and Ticket in the LookupCombo OnChange event. I understand you've
said that that's the wrong place to put that code anyway. Where should I put
it? I've messed with the OnDataChange event of Ticket's datasource but can't
make it work (and I'm not sure that's the right place anyway).
This is the code I want to run when the user selects a Lading.
qrTicket['RATE'] := qrLading['RATE'];
qrTicket['UNIT'] := qrLading['UNIT'];
if PurchSale.ItemIndex = 0 then begin
qrTicket['CONT_ID'] := qrLading['O_CONT_ID'];
qrTicket['CUST_ID'] := qrLading['ORIG_ID'];
end else begin
qrTicket['CONT_ID'] := qrLading['D_CONT_ID'];
qrTicket['CUST_ID'] := qrLading['DEST_ID'];