Subject | Re: [IBO] TIB_LookupCombo question |
---|---|
Author | James N Hitz |
Post date | 2006-10-02T16:08:19Z |
To use more than one TIB_LookupCombo's referencing the same table I use a different alias for each instance of the field and map my KeyLinks using the aliases eg:
TIB_Query1 (
SELECT ExamId, Class, ExamSession,
BestStudentID,
(SELECT FullName FROM students WHERE StudentId = BestStudentId AS BestStudentName),
WorstStudentID
(SELECT FullName FROM students WHERE StudentId = WorstStudentId AS WorstStudentName)
FROM Exams)
TIB_Query2 (SELECT StudentID, FullName FROM Students BestStudent)
KeyLinks ="StudentId = Exams.BestStudentId"
KeyDescLinks = "FullName = Exams.BestStudentName"
KeySource = TIB_Query1
TIB_Query2 (SELECT StudentID, FullName FROM Students WorstStudent);
KeyLinks ="StudentId = Exams.WorstStudentId"
KeyDescLinks = "FullName = Exams.WorstStudentName"
KeySource = TIB_Query1
I would then link the TIB_LookupCombo's to each of the 2 lookup queries (TIB_Query2 and TIB_Query3).
The computer I am using right now does not have Delphi installed so I did not get to try this practically. I hope I did not skip or forget anything.... that's the general direction though.
Thanks
James N Hitz
TIB_Query1 (
SELECT ExamId, Class, ExamSession,
BestStudentID,
(SELECT FullName FROM students WHERE StudentId = BestStudentId AS BestStudentName),
WorstStudentID
(SELECT FullName FROM students WHERE StudentId = WorstStudentId AS WorstStudentName)
FROM Exams)
TIB_Query2 (SELECT StudentID, FullName FROM Students BestStudent)
KeyLinks ="StudentId = Exams.BestStudentId"
KeyDescLinks = "FullName = Exams.BestStudentName"
KeySource = TIB_Query1
TIB_Query2 (SELECT StudentID, FullName FROM Students WorstStudent);
KeyLinks ="StudentId = Exams.WorstStudentId"
KeyDescLinks = "FullName = Exams.WorstStudentName"
KeySource = TIB_Query1
I would then link the TIB_LookupCombo's to each of the 2 lookup queries (TIB_Query2 and TIB_Query3).
The computer I am using right now does not have Delphi installed so I did not get to try this practically. I hope I did not skip or forget anything.... that's the general direction though.
Thanks
James N Hitz
----- Original Message -----
From: maralex1949
To: IBObjects@yahoogroups.com
Sent: Saturday, September 30, 2006 4:13 AM
Subject: [IBO] TIB_LookupCombo question
I have an application where I need to keep track of classes what
students wish to sign up for in different quarters of the school
year. I have a table that stores all available classes. I have a
form that has several tib_lookupcombos. In the BDE version, since
the lookupcombo has both a list source/keyfield and a
datasource/datafield relationship, I can have all of the
lookupcombos accessing the same "classes" table yet updating
different fields in the student file so the student can sign up for
4 different classes, 1 per school quarter. In the IBO version I
can't figure out how to accomplish the same thing. Since the
tib_lookupcombo only has a datasource and, as far as I can figure,
the relationship is set using keylinks, am I limited to one
tib_lookupcombo on the form since adding more continue to update the
same field in the students file based on the defined keylinks. I
realize that I can keep changing the keylinks but that only semi
works because it messes up the display since once changed the
tib_lookupcombo that displayed class x now displays class y because
the keylink effects all of tib_lookupcombos on the form. Can
someone tell me what I am missing?
Thanks
[Non-text portions of this message have been removed]