Subject | RE: [IBO] TIB_LookupCombo - Join Tables - too ambitious?? |
---|---|
Author | Dion Oliphant |
Post date | 2002-09-12T06:28:41Z |
Hi,
My intention is to allow a user to add to the COVEREDMEM table from within a
TIB_Grid. when the user enters an 'ID' in the Person's ID column, the
associated TIB_LookupCombo control must drop down and do an incremental
search for this ID(not PersonId - which is a gen value). If the value is
matched, and the user... from here I believe I can handle the various
scenarios. My problem is the incremental searching. It does not work for
INSERTING. It works for EDITING! I believe it has to do with the
KeyDescLinks. I get the TIB_LookupCombo to work out of the grid. Anyway,
here are the settings:-
LookupDataset:
PERSON(SQL)
------
SELECT PERSONID
, FIRSTNAME
, SURNAME
, ID
, TitleId
, Initials
FROM PERSON
KeyLinks -> Person.PersonId=CoveredMem.PersonId
KeyDescLinks -> Person.ID=id
OrderingItems -> ID=ID
OrderingLinks -> ID=1
KeySource -> dsCoveredFamMem
KeySource Dataset:
COVEREDMEM(SQL)
----------
SELECT COVEREDMEM.RELATIVETYPEID
,COVEREDMEM.PERSONID
,COVEREDMEM.FUNDID
,COVEREDMEM.OPTIONID
,COVEREDMEM.MEMBERID
,COVEREDMEM.STATUSID
,COVEREDMEM.DOI
,PERSON.PERSONID
,PERSON.FIRSTNAME
,PERSON.SURNAME
,PERSON.DOB
,PERSON.TITLEID
,PERSON.INITIALS
,PERSON.HOMETEL
,PERSON.WORKTEL
,PERSON.EMAIL
,PERSON.ID
,PERSON.UNIONID
,PERSON.GROUPID
,(SELECT TITLE
FROM TITLE
WHERE TITLE.TITLEID = PERSON.TITLEID)
AS TITLENAME
,(SELECT NAME
FROM RELATIVETYPE
WHERE RELATIVETYPE.RELATIVETYPEID =
COVEREDMEM.RELATIVETYPEID)
AS RELNAME
,(SELECT MEMSTATUSNAME
FROM MEMSTATUS
WHERE MEMSTATUS.MEMSTATUSID =
COVEREDMEM.STATUSID)
AS STATUSNAME
,(SELECT NAME
FROM UNIONS
WHERE UNIONS.UNIONID = PERSON.UNIONID)
AS UNIONNAME
,(SELECT GROUPNAME
FROM GROUPS
WHERE GROUPS.GROUPID = PERSON.GROUPID)
AS GROUP_NAME
,(SELECT ID
FROM PERSON
WHERE COVEREDMEM.PERSONID = PERSON.PERSONID)
AS LOOKUP_ID { I believe this is needed for the KeyDescLinks }
FROM COVEREDMEM
JOIN PERSON
ON (PERSON.PERSONID = COVEREDMEM.PERSONID)
WHERE (COVEREDMEM.MEMBERID = :MEMBERID)
AND (COVEREDMEM.FUNDID = :FUNDID)
AND (COVEREDMEM.OPTIONID = :OPTIONID)
KeyLinks -> COVEREDMEM.MEMBERID
COVEREDMEM.PERSONID
COVEREDMEM.OPTIONID
COVEREDMEM.FUNDID
EditSQL -> Execute procedure UpdateCovMem( :Person.TITLEID
, :Person.Id
, :Person.INITIALS
, :Person.FIRSTNAME
, :Person.SURNAME
, :Person.DOB
, :CoveredMem.STATUSID
, :CoveredMem.ReLativeTYPEID
, :Person.UnionId
, :Person.Groupid
, :CoveredMem.PersonId
, :CoveredMem.OptionId
, :CoveredMem.FundId
, :CoveredMem.MemberId
, :CoveredMem.DOI )
InsertSQL -> Execute Procedure Insert_CovMem( :Person.PersonId
, :Person.ID
, :Person.INITIALS
, :Person.FIRSTNAME
, :Person.SURNAME
, :Person.TITLEID
, :Person.HOMETEL
, :Person.WORKTEL
, :Person.EMAIL
, :Person.UNIONID
, :Person.DOB
, :Person.GROUPID
, :CoveredMem.MEMBERID
, :CoveredMem.PERSONID
, :CoveredMem.RELATIVETYPEID
, :CoveredMem.OPTIONID
, :CoveredMem.FUNDID
, :CoveredMem.STATUSID
, :CoveredMem.DOI )
Many Thanks,
Dion.
-----Original Message-----
From: Raymond Kennington [mailto:raymondk@...]
Sent: Thursday, September 12, 2002 1:11 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] TIB_LookupCombo
Dion Oliphant wrote:
It is necessary to connect the main table's stored field with the lookup
table's field
that is being stored.
This is due to the need to provide a connection between the tables. What you
search on,
sort by, filter by and display is a separate issue.
'lookup field' means the matching field, namely PersonID in this case.
Raymond Kennington
___________________________________________________________________________
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 !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
My intention is to allow a user to add to the COVEREDMEM table from within a
TIB_Grid. when the user enters an 'ID' in the Person's ID column, the
associated TIB_LookupCombo control must drop down and do an incremental
search for this ID(not PersonId - which is a gen value). If the value is
matched, and the user... from here I believe I can handle the various
scenarios. My problem is the incremental searching. It does not work for
INSERTING. It works for EDITING! I believe it has to do with the
KeyDescLinks. I get the TIB_LookupCombo to work out of the grid. Anyway,
here are the settings:-
LookupDataset:
PERSON(SQL)
------
SELECT PERSONID
, FIRSTNAME
, SURNAME
, ID
, TitleId
, Initials
FROM PERSON
KeyLinks -> Person.PersonId=CoveredMem.PersonId
KeyDescLinks -> Person.ID=id
OrderingItems -> ID=ID
OrderingLinks -> ID=1
KeySource -> dsCoveredFamMem
KeySource Dataset:
COVEREDMEM(SQL)
----------
SELECT COVEREDMEM.RELATIVETYPEID
,COVEREDMEM.PERSONID
,COVEREDMEM.FUNDID
,COVEREDMEM.OPTIONID
,COVEREDMEM.MEMBERID
,COVEREDMEM.STATUSID
,COVEREDMEM.DOI
,PERSON.PERSONID
,PERSON.FIRSTNAME
,PERSON.SURNAME
,PERSON.DOB
,PERSON.TITLEID
,PERSON.INITIALS
,PERSON.HOMETEL
,PERSON.WORKTEL
,PERSON.EMAIL
,PERSON.ID
,PERSON.UNIONID
,PERSON.GROUPID
,(SELECT TITLE
FROM TITLE
WHERE TITLE.TITLEID = PERSON.TITLEID)
AS TITLENAME
,(SELECT NAME
FROM RELATIVETYPE
WHERE RELATIVETYPE.RELATIVETYPEID =
COVEREDMEM.RELATIVETYPEID)
AS RELNAME
,(SELECT MEMSTATUSNAME
FROM MEMSTATUS
WHERE MEMSTATUS.MEMSTATUSID =
COVEREDMEM.STATUSID)
AS STATUSNAME
,(SELECT NAME
FROM UNIONS
WHERE UNIONS.UNIONID = PERSON.UNIONID)
AS UNIONNAME
,(SELECT GROUPNAME
FROM GROUPS
WHERE GROUPS.GROUPID = PERSON.GROUPID)
AS GROUP_NAME
,(SELECT ID
FROM PERSON
WHERE COVEREDMEM.PERSONID = PERSON.PERSONID)
AS LOOKUP_ID { I believe this is needed for the KeyDescLinks }
FROM COVEREDMEM
JOIN PERSON
ON (PERSON.PERSONID = COVEREDMEM.PERSONID)
WHERE (COVEREDMEM.MEMBERID = :MEMBERID)
AND (COVEREDMEM.FUNDID = :FUNDID)
AND (COVEREDMEM.OPTIONID = :OPTIONID)
KeyLinks -> COVEREDMEM.MEMBERID
COVEREDMEM.PERSONID
COVEREDMEM.OPTIONID
COVEREDMEM.FUNDID
EditSQL -> Execute procedure UpdateCovMem( :Person.TITLEID
, :Person.Id
, :Person.INITIALS
, :Person.FIRSTNAME
, :Person.SURNAME
, :Person.DOB
, :CoveredMem.STATUSID
, :CoveredMem.ReLativeTYPEID
, :Person.UnionId
, :Person.Groupid
, :CoveredMem.PersonId
, :CoveredMem.OptionId
, :CoveredMem.FundId
, :CoveredMem.MemberId
, :CoveredMem.DOI )
InsertSQL -> Execute Procedure Insert_CovMem( :Person.PersonId
, :Person.ID
, :Person.INITIALS
, :Person.FIRSTNAME
, :Person.SURNAME
, :Person.TITLEID
, :Person.HOMETEL
, :Person.WORKTEL
, :Person.EMAIL
, :Person.UNIONID
, :Person.DOB
, :Person.GROUPID
, :CoveredMem.MEMBERID
, :CoveredMem.PERSONID
, :CoveredMem.RELATIVETYPEID
, :CoveredMem.OPTIONID
, :CoveredMem.FUNDID
, :CoveredMem.STATUSID
, :CoveredMem.DOI )
Many Thanks,
Dion.
-----Original Message-----
From: Raymond Kennington [mailto:raymondk@...]
Sent: Thursday, September 12, 2002 1:11 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] TIB_LookupCombo
Dion Oliphant wrote:
>of
> Hi,
>
> I have the following tables
>
> Person
> ------
> PersonId ID Firstname Surname
>
> Member
> ------
> MemberId Firstname Surname
>
> CoveredMem
> ----------
> MemberId PersonId OptionId FundId
>
> I use qryCoveredFamMem to add Covered members to the CoveredMem table.
> qryCoveredFamMem is a join of CoveredMem and Person - Fields are a combo
> both tables.be
>
> I need to display a drop down of the person table with the ID field as the
> lookup field, but the field to be inserted into the CoveredMem table must
It is necessary to connect the main table's stored field with the lookup
table's field
that is being stored.
This is due to the need to provide a connection between the tables. What you
search on,
sort by, filter by and display is a separate issue.
'lookup field' means the matching field, namely PersonID in this case.
Raymond Kennington
___________________________________________________________________________
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 !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/