Subject | TIB_LookupCombo and Grids |
---|---|
Author | Bob |
Post date | 2002-04-30T22:25:06Z |
Well I just mistakenly posted this to the ib-support newsgroup. My
apologies.
I have a LookupCombo in a grid. The grid is displaying a detail dataset, and
the lookup combo is reference to another table. However I want the
LookupCombo to display a descriptive field, rather than a primary key. See
below:
qrLOCATION table is the master, containing LOC_ID, LOC_NAME.
KeyLinks : LOC_ID
qrFRTLANE is the detail dataset,
SELECT LANE_ID
, ORIG_ID
, DEST_ID
, (SELECT LOC_NAME FROM LOCATION L
WHERE L.LOC_ID = F.DEST_ID) AS
DEST_NAME
, RATE
FROM FRTLANE F
KeyLinks: LANE_ID
MasterLinks: FRTLANE.ORIG_ID=LOCATION.LOC_ID
Note: DEST_ID is also a reference to the Location table.
qrDEST (which is SELECT LOC_ID, LOC_NAME FROM LOCATION) { this is for the
LookupCombo that's on the grid }
KeyLinks: LOCATION.LOC_ID=FRTLANE.DEST_ID { this seems to work fine }
KeyDescLinks : LOCATION.LOC_NAME=FRTLANE.DEST_NAME { I don't know if
this is correct }
Each Location has multiple Freight Lanes associated with it. The user can
add new freight lanes, but when adding freight lanes I want him/her to be
able to looking up the Location (Destination) Name, rather than the ID. It's
working now based on the ID but that's not terribly friendly.
Make sense? Let me know if I need to provide more info. I've been up and
down through the docs and FAQ's and Tech Sheets and such, and am stumped.
Though Jason will probably tell me (again) that it's already been documented
somewhere!
Thanks.
Bob.
apologies.
I have a LookupCombo in a grid. The grid is displaying a detail dataset, and
the lookup combo is reference to another table. However I want the
LookupCombo to display a descriptive field, rather than a primary key. See
below:
qrLOCATION table is the master, containing LOC_ID, LOC_NAME.
KeyLinks : LOC_ID
qrFRTLANE is the detail dataset,
SELECT LANE_ID
, ORIG_ID
, DEST_ID
, (SELECT LOC_NAME FROM LOCATION L
WHERE L.LOC_ID = F.DEST_ID) AS
DEST_NAME
, RATE
FROM FRTLANE F
KeyLinks: LANE_ID
MasterLinks: FRTLANE.ORIG_ID=LOCATION.LOC_ID
Note: DEST_ID is also a reference to the Location table.
qrDEST (which is SELECT LOC_ID, LOC_NAME FROM LOCATION) { this is for the
LookupCombo that's on the grid }
KeyLinks: LOCATION.LOC_ID=FRTLANE.DEST_ID { this seems to work fine }
KeyDescLinks : LOCATION.LOC_NAME=FRTLANE.DEST_NAME { I don't know if
this is correct }
Each Location has multiple Freight Lanes associated with it. The user can
add new freight lanes, but when adding freight lanes I want him/her to be
able to looking up the Location (Destination) Name, rather than the ID. It's
working now based on the ID but that's not terribly friendly.
Make sense? Let me know if I need to provide more info. I've been up and
down through the docs and FAQ's and Tech Sheets and such, and am stumped.
Though Jason will probably tell me (again) that it's already been documented
somewhere!
Thanks.
Bob.