LindaRichard
Programmer
Hi,
I have a form that contains the tables rockfile and gsc_age in the data environment. In the load event of this form I create a view called tmp_rock which includes fields only from rockfile. Here is an example SQL
CREATE SQL VIEW tmp_rock AS SELECT DISTINCT r.* from rockfile r, gsc_age a
where a.age > 1500 and r.prov='ON'
and r.labno=a.labno
The tmp_rock view is then displayed in a grid.
I want to print in a report the tmp_rock and gsc_age information for one record
So I am trying to set the relation between tmp_rock and gsc_age. For one tmp_rock
record there can be many gsc_age.
Here is my code
*make sure the table is seleted
select tmp_rock
*set a relationship between tmp_rock and gsc_age
set relation to labno into gsc_age
*set the relation to one to many
set skip to gsc_age
*----------------------------------------------------------------
*preview the report
*----------------------------------------------------------------
*user has selected to preview one sample
REPORT FORM rockfrm for tmp_rock.labno=ThisForm.pfrock.Page1.txtLabno.value PREVIEW
*----------------------------------------------------------------
*clear the table relationship
*----------------------------------------------------------------
*select the table
select tmp_rock
*clear the relationship
set relation to
*clear the one to many
set skip to
My problem is that I keep getting the following error message
gsc_age is not related to the current work area.
Any ideas what I am doing wrong.
Thanks
Linda
I have a form that contains the tables rockfile and gsc_age in the data environment. In the load event of this form I create a view called tmp_rock which includes fields only from rockfile. Here is an example SQL
CREATE SQL VIEW tmp_rock AS SELECT DISTINCT r.* from rockfile r, gsc_age a
where a.age > 1500 and r.prov='ON'
and r.labno=a.labno
The tmp_rock view is then displayed in a grid.
I want to print in a report the tmp_rock and gsc_age information for one record
So I am trying to set the relation between tmp_rock and gsc_age. For one tmp_rock
record there can be many gsc_age.
Here is my code
*make sure the table is seleted
select tmp_rock
*set a relationship between tmp_rock and gsc_age
set relation to labno into gsc_age
*set the relation to one to many
set skip to gsc_age
*----------------------------------------------------------------
*preview the report
*----------------------------------------------------------------
*user has selected to preview one sample
REPORT FORM rockfrm for tmp_rock.labno=ThisForm.pfrock.Page1.txtLabno.value PREVIEW
*----------------------------------------------------------------
*clear the table relationship
*----------------------------------------------------------------
*select the table
select tmp_rock
*clear the relationship
set relation to
*clear the one to many
set skip to
My problem is that I keep getting the following error message
gsc_age is not related to the current work area.
Any ideas what I am doing wrong.
Thanks
Linda