Subject | Lookup that changes with another column value |
---|---|
Author | cwbauer2003 |
Post date | 2005-03-21T18:36:01Z |
Is it possible to have a lookup combo in a grid such that the contents of
the drop down list change depending on another field in the source table?
ie:
from the master table ibo_query.sql
SELECT ID
, COMP_TYPE
, (SELECT DESCRIPTION FROM COMP_TYPES // this ordinary one works
fine
WHERE comp_types.ID=Master.COMP_TYPE) AS C_TYPE
, PROPERTY_TYPE_ID
, (SELECT DESCRIPTION FROM PROPTYPES P // this one doesn't
WHERE (PROPTYPES.COMP_TYPE=MASTER.COMP_TYPE) AND
(PROPTYPES.ID=MASTER.PROPERTY_TYPE_ID)) AS PROP_TYPE
... other unrelated columns
from master m
The lookup table is:
CREATE TABLE PROPTYPES
(
ID integer not null,
COMP_TYPE INTEGER,
DESCRIPTION CHAR(25),
CONSTRAINT PK_PROPTYPES PRIMARY KEY (ID)
);
its sql is just select * from proptypes or I also tried
select p.comp_type, p.description, m.comp_type
from Proptypes P, master M
where (p.comp_type=m.comp_type)
so that the contents of the drop down list are based on what is in the
comp_type column of the master table.
Tried a lot of combinations of KeyLinks and SQL but always get all rows of
the proptypes table in the lookup or column not found errors.
Environment is FB 1.5.2, IBO 43Aa, Delphi 4, Win2000
Any suggestions would be very welcome.
Thanks
Chuck Bauer
the drop down list change depending on another field in the source table?
ie:
from the master table ibo_query.sql
SELECT ID
, COMP_TYPE
, (SELECT DESCRIPTION FROM COMP_TYPES // this ordinary one works
fine
WHERE comp_types.ID=Master.COMP_TYPE) AS C_TYPE
, PROPERTY_TYPE_ID
, (SELECT DESCRIPTION FROM PROPTYPES P // this one doesn't
WHERE (PROPTYPES.COMP_TYPE=MASTER.COMP_TYPE) AND
(PROPTYPES.ID=MASTER.PROPERTY_TYPE_ID)) AS PROP_TYPE
... other unrelated columns
from master m
The lookup table is:
CREATE TABLE PROPTYPES
(
ID integer not null,
COMP_TYPE INTEGER,
DESCRIPTION CHAR(25),
CONSTRAINT PK_PROPTYPES PRIMARY KEY (ID)
);
its sql is just select * from proptypes or I also tried
select p.comp_type, p.description, m.comp_type
from Proptypes P, master M
where (p.comp_type=m.comp_type)
so that the contents of the drop down list are based on what is in the
comp_type column of the master table.
Tried a lot of combinations of KeyLinks and SQL but always get all rows of
the proptypes table in the lookup or column not found errors.
Environment is FB 1.5.2, IBO 43Aa, Delphi 4, Win2000
Any suggestions would be very welcome.
Thanks
Chuck Bauer