|
Home > Archive > Getting Started with dBASE > June 2005 > beforeGetValue HELP!
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
beforeGetValue HELP!
|
|
| John Marshall 2005-06-29, 11:23 am |
|
I am still trying to get two files to show in one grid. I cannot morph and lose my main primary field, nor can I get masterRowset to work, and left outer joins do not allow editing.
What I was attempting is to use BeforeGetValue to perform a lookup of file 2 and add it to the grid (since the employee name is for reference only.
Here is my code sample called by an on_open in the primary table:
function tip1_onOpen
local X
x = new field()
x.fieldname := "Name"
x.beforeGetValue := { || this.parent.parent.premp2.rowset.findkey(
this.parent["contrib"].value);
return this.parent.parent.premp2.rowset.fields["last"].value }
this.rowset.fields.add(x)
return
The error is that 'premp2' (the lookup employee table) is undefined. Can anyone suggest a fix, or tell me if this is an avenue with potential?
Thanks,
JM
| |
| Marc Hamelin 2005-06-29, 8:23 pm |
| Try FOUR parents. The THIS stands for the current calculated field, the
first PARENT stands for the Fields array, the second PARENT stands for the
Rowset, the third PARENT stands for the query and the fourth PARENT stands
for the Form.
Here's how it should be:
local X
x = new field()
x.fieldname := "Name"
x.beforeGetValue := {;
this.parent.parent.parent.parent.premp2.rowset.findkey(this.parent["contrib"
].value);
return
this.parent.parent.parent.parent.premp2.rowset.fields["last"].value}
this.rowset.fields.add(x)
|
|
|
|
|