Subject Re: [IBO] Lookup that changes with another column value
Author radevojvodic
As i understood your situation is that you have three tables MASTER,
COMP_TYPES and PROP_TYPES. Master is looking for COMP_TYPE in
COM_TYPES and looking for PROP_TYPE in a PROP_TYPES table. Also,
PROP_TYPES looking for a COMP_TYPE in a COMP_TYPES table. I would do
the following:

Lookup query for COMP_TYPE you know how to do, for prop_type make a
query which KeyLink is related to MASTER table and MasterKey is
related to COMP_TYPE table. So, if you select one COMP_TYPE then
lookup query for comp_type will be positioned on the right key, and
PROP_Type through masterkey will retrieve just prop_type with
selected COMP_TYPE and in a TIB_LookupCombo you will see subset of
PROP_TYPES which has selected COMP_TYPE value.

I hope you will understand this.

Rade

--- In IBObjects@yahoogroups.com, "Jason Wharton" <jwharton@i...>
wrote:
> I think that may not be very feasible.
> In the grid it would need to revisit the different query
conditions for each
> record as it were painted and if the lookup dataset needed to be
refreshed
> in this process that would take too long.
>
>
> Jason
>
> > -----Original Message-----
> > From: cwbauer2003 [mailto:chuck@p...]
> > Sent: Monday, March 21, 2005 11:36 AM
> > To: IBObjects@yahoogroups.com
> > Subject: [IBO] Lookup that changes with another column value
> >
> >
> >
> >
> > 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
> >
> >
> >
> >
> >
> >
> > ______________________________________________________________
> > _____________
> > IB Objects - direct, complete, custom connectivity to
> > Firebird or InterBase
> > without the need for BDE, ODBC or any other layer.
> > ______________________________________________________________
> > _____________
> > http://www.ibobjects.com - your IBO community resource for
> > Tech Info papers,
> > keyword-searchable FAQ, community code contributions and more
> > !
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >