Procedure for Looking Up Calculated Fields 
Author Message
 Procedure for Looking Up Calculated Fields

Help!

How can you create a lookup field that returns a calculated
field from another table?

I have a master table named Students that holds student information,
including a primary key field fSID of type string.  In another table called
Counselors, I have counselor information with a primary key field
fCounsCode of type integer.

I need to be able to add more than one counselor to each student record in
a master-detail relationship.  To accomplish this, I've created a third
transaction table called StudCounselors which has two fields - fSID and
fCounsCode with a primary compound key on both fields.

There is a master detail relationship between Students and StudCounselors.
When I display Student information in a one TDBGrid, the linked
StudCounselor information (fSID and fCounsCode) is displayed in another
TDBGrid.  However, the fCounsCode integer is not very meaningful to a user.

So I created a lookup field in StudCounselors that looks up a field in
Counselors and returns the field value.

Here's the problem - when I lookup a regular field (like the counselors
first name [fFirstName]), the TDBGrid displays correctly.  However, to get
the counselor's full name, I created a CALCULATED field in Counselors which
concatenates the counselor's first and last names.  But when I lookup this
calculated field, the TDBGrid returns nothing, including the fCounsCode.

Why?

David Sweeney
Texas A&M University



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How to re-calculate a calculated field

2. Filter on Lookup Field or Calculated Field

3. Lookup field based on calculated field - possible ?

4. Procedure to calculate Day of Week

5. WANTED: Procedure to calculate Day of Week

6. Looking for information about C/S 2.0 stored Procedures

7. Looking for some VGA procedures, help!

8. Looking for certain VGA procedures, can you help?

9. Looking for generic Save/Loadscreen-procedure

10. Looking for a window procedure for TP7.0

11. New UPS System 6-8 Hours Continuous Service

12. Ups and Downs of OOP

 

 
Powered by phpBB® Forum Software