Displaying fields in a DBBrowse object from two related tables
Publicado: Mié Jun 17, 2009 10:19 pm
A DBBrowse object is linked with one dataset.
The datacontrols.htm discusses constructing a calculated field.
I have one table (and thus a dataset) that has attorney information records,
which includes the attorney's name (CAATTRNY.DBF)
I have another table, related to the first through a unique identifier, that
has records that link that attorney to assigned cases. This table does not
have the attorney's name, just a pointer to the attorney's record in the
first table (CAASATT.DBF).
On the case screen, I want to put a DBBrowse object showing attorneys
assigned to that case by name.
My question is how to best accomplish this.
Should I add a calculated field to the dataset of assigned attorneys to show
the NAME field from the first dataset? If so, could you give me the proper
syntax? The sample documentation shows how to create a calculated field by
combining fields from the same dataset. In this case, I would be adding a
field from a different dataset.
In my Clipper app, I simply related the two tables and referenced the fully
qualified field name in the column of the TBrowse. I am guessing I could
scope the CAATTRNY dataset based upon the selected record in the CAASATT
dataset and then attach the DBBrowse object to the CAATTRNY dataset.
So, would either method work? Which is best or easiest?
TIA,
Gary
The datacontrols.htm discusses constructing a calculated field.
I have one table (and thus a dataset) that has attorney information records,
which includes the attorney's name (CAATTRNY.DBF)
I have another table, related to the first through a unique identifier, that
has records that link that attorney to assigned cases. This table does not
have the attorney's name, just a pointer to the attorney's record in the
first table (CAASATT.DBF).
On the case screen, I want to put a DBBrowse object showing attorneys
assigned to that case by name.
My question is how to best accomplish this.
Should I add a calculated field to the dataset of assigned attorneys to show
the NAME field from the first dataset? If so, could you give me the proper
syntax? The sample documentation shows how to create a calculated field by
combining fields from the same dataset. In this case, I would be adding a
field from a different dataset.
In my Clipper app, I simply related the two tables and referenced the fully
qualified field name in the column of the TBrowse. I am guessing I could
scope the CAATTRNY dataset based upon the selected record in the CAASATT
dataset and then attach the DBBrowse object to the CAATTRNY dataset.
So, would either method work? Which is best or easiest?
TIA,
Gary