Subject Re: TIB_LookupCombo: no selection possible
Author mirco@intellitec.de
Here is some more information regarding the problem I reported:
The problem is based on 3 tables:

ASSAY = ASSAYID (PK), ASSAYNO, NAME
SAMPLETYPE = SAMPLETYPEID(PK), SAMPLETYPENO, NAME

TEST = TESTID (PK), TESTNO, SAMPLETYPEID(FK), ASSAYID(FK), ...

The issue is in a dialog with 2 comboboxes to edit the TEST
table where one works (lookupType) and the other doesnt
(lookupAssay). Here is the DFM
of the two combos:
---------------------------------------------------------
object lookupAssay: TIB_LookupCombo
Left = 8
Top = 120
Width = 177
Height = 21
DataSource = dataSourceAssay
TabOrder = 0
DisplayField = 'ASSAYNO'
ShowButton = True
end
object lookupType: TIB_LookupCombo
Left = 192
Top = 120
Width = 201
Height = 21
DataSource = dataSourceType
TabOrder = 1
DisplayField = 'NAME'
ShowButton = True
end
---------------------------------------------------------
No difference here I think. Here are the two queries the
combos use to look up their entries:
---------------------------------------------------------
object queryType: TIB_Query
DatabaseName = ....
FieldsVisible.Strings = (
'SAMPLETYPEID=FALSE')
IB_Connection = ProPXGlobal.databaseConnection
SQL.Strings = (
'SELECT *'
'FROM SAMPLETYPE')
ColorScheme = False
KeyLinks.Strings = (
'SAMPLETYPE.SAMPLETYPEID=TEST.SAMPLETYPEID')
KeySource = dataSource
MasterSearchFlags = [msfOpenMasterOnOpen,
msfSearchAppliesToMasterOnly]
OrderingItemNo = 1
OrderingItems.Strings = (
'SAMPLETYPENO=SAMPLETYPENO;SAMPLETYPENO DESC'
'NAME=NAME;NAME DESC')
OrderingLinks.Strings = (
'SAMPLETYPENO=1'
'NAME=2')
BufferSynchroFlags = []
FetchWholeRows = True
Left = 192
Top = 136
end
object queryAssay: TIB_Query
DatabaseName = ....
FieldsVisible.Strings = (
'ASSAYID=FALSE'
'ASSAYCATEGORYID=FALSE'
'DISPLAYPOS=FALSE')
IB_Connection = ProPXGlobal.databaseConnection
SQL.Strings = (
'SELECT *'
'FROM ASSAY')
ColorScheme = False
KeyLinks.Strings = (
'ASSAY.ASSAYID=TEST.ASSAYID')
KeySource = dataSource
MasterSearchFlags = [msfOpenMasterOnOpen,
msfSearchAppliesToMasterOnly]
OrderingItemNo = 1
OrderingItems.Strings = (
'ASSAYNO=ASSAYNO;ASSAYNO DESC'
'NAME=NAME;NAME DESC')
OrderingLinks.Strings = (
'ASSAYNO=1'
'NAME=2')
BufferSynchroFlags = []
FetchWholeRows = True
Left = 8
Top = 136
end
---------------------------------------------------------
Both queries seem to be ok to me. Here is the query for the
TEST table:
---------------------------------------------------------
object queryTests: TIB_Query
DatabaseName =
'C:\Documents and Settings\mirco\My
Documents\ITEC\Projects\ProPX' +
'\data\ProPX.gdb'
IB_Connection = ProPXGlobal.databaseConnection
SQL.Strings = (
'SELECT *'
'FROM ASSAY, TEST LEFT OUTER JOIN SAMPLETYPE'
'ON SAMPLETYPE.SAMPLETYPEID=TEST.SAMPLETYPEID'
'WHERE ASSAY.ASSAYID=TEST.ASSAYID')
ColorScheme = False
DeleteSQL.Strings = (
'DELETE FROM TEST'
'WHERE'
' TESTID = :OLD_TESTID')
EditSQL.Strings = (
'UPDATE TEST SET'
' TESTNO = :TESTNO,'
' ASSAYID = :ASSAYID,'
' SAMPLETYPEID = :SAMPLETYPEID,'
' ENABLED = :ENABLED,'
' INSTRUMENTID = :INSTRUMENTID'
'WHERE'
' TESTID = :OLD_TESTID')
InsertSQL.Strings = (
'INSERT INTO TEST('
' TESTID, /*PK*/'
' TESTNO,'
' ASSAYID,'
' SAMPLETYPEID,'
' ENABLED,'
' INSTRUMENTID)'
'VALUES ('
' :TESTID,'
' :TESTNO,'
' :ASSAYID,'
' :SAMPLETYPEID,'
' :ENABLED,'
' :INSTRUMENTID)')
MasterSource = dataSource
MasterLinks.Strings = (
'TEST.INSTRUMENTID=INSTRUMENT.INSTRUMENTID')
MasterSearchFlags = [msfOpenMasterOnOpen,
msfSearchAppliesToMasterOnly]
OrderingItemNo = 2
OrderingItems.Strings = (
'ASSAYID=ASSAY.ASSAYID;ASSAY.ASSAYID DESC'
'ASSAYNO=ASSAY.ASSAYNO;ASSAY.ASSAYNO DESC'
'NAME=ASSAY.NAME;ASSAY.NAME DESC'
'COLOR=ASSAY.COLOR;ASSAY.COLOR DESC'
'MOLWEIGHT=ASSAY.MOLWEIGHT;ASSAY.MOLWEIGHT DESC'
'TESTID=TEST.TESTID;TEST.TESTID DESC'
'TESTNO=TEST.TESTNO;TEST.TESTNO DESC'
'ASSAYID1=TEST.ASSAYID;TEST.ASSAYID DESC'
'SAMPLETYPEID=TEST.SAMPLETYPEID;TEST.SAMPLETYPEID DESC'
'ENABLED=TEST.ENABLED;TEST.ENABLED DESC'
'INSTRUMENTID=TEST.INSTRUMENTID;TEST.INSTRUMENTID DESC'

'SAMPLETYPEID1=SAMPLETYPE.SAMPLETYPEID;SAMPLETYPE.SAMPLETYPEID
DE' +
'SC'

'SAMPLETYPENO=SAMPLETYPE.SAMPLETYPENO;SAMPLETYPE.SAMPLETYPENO
DES' +
'C'
'NAME1=SAMPLETYPE.NAME;SAMPLETYPE.NAME DESC')
OrderingLinks.Strings = (
'ASSAYID=1'
'ASSAYNO=2'
'NAME=3'
'COLOR=4'
'MOLWEIGHT=5'
'TESTID=6'
'TESTNO=7'
'ASSAYID1=8'
'SAMPLETYPEID=9'
'ENABLED=10'
'INSTRUMENTID=11'
'SAMPLETYPEID1=12'
'SAMPLETYPENO=13'
'NAME1=14')
SearchingLinks.Strings = (
'ASSAYID=ASSAYID'
'ASSAYNO=ASSAYNO'
'NAME=NAME'
'COLOR=COLOR'
'MOLWEIGHT=MOLWEIGHT'
'TESTID=TESTID'
'TESTNO=TESTNO'
'ASSAYID1=ASSAYID1'
'SAMPLETYPEID=SAMPLETYPEID'
'ENABLED=ENABLED'
'INSTRUMENTID=INSTRUMENTID'
'SAMPLETYPEID1=SAMPLETYPEID1'
'SAMPLETYPENO=SAMPLETYPENO'
'NAME1=NAME1')
BufferSynchroFlags = []
FetchWholeRows = True
Left = 168
Top = 352
end
---------------------------------------------------------
Nothing unusual here as well. The query is a detail
query for another datasource, but I don't see any
difference between ASSAYID and SAMPLETYPEID. One
works, the other doesn't.

Again, the problem is that I can properly see the
contents of the ASSAYID field changing in the combo
as I scroll through the TEST query. When I open the
combo list, it contains the contents of the ASSAY
table. But clicking on one doesn't change the selection.

I tried to drop and edit field to enter the TEST.ASSAYID
directly. This works.

Any ideas?

Mirco