I have a simple app. One form(1) that calls another form(2) and then has the ability to print a report. Each form uses a single table. Form1 works with a parent table1, which allows you to find an account. Form2 then pulls the account details from a second table2 based on a relation as follows:
&&form1
select table1
set relation ... into table2
&& call form2
If you choose to print the report, a query is run to pull the matching records into a cursor and the report is printed from based on the cursor.
The problem that I'm having has to do with the change of the active table. When I print the report the cursor is created and selected however sometimes I get an error that it can't find one of the fields in the report because the table that is actually selected isn't the report cursor. This is odd because prior to actually issuing the "report form" command I check the currently selected table and it is correct. But once I issue "report form" the selected table is changes to the first table I opened and not the report cursor.
The report data environment is empty and the report NOT running in a private data session. The code to run the report is as follows:
selece *... into cursor myCursor
Select MyCursor
report form ....
use in myCursor
Any ideas or suggestions would be greatly appreciated.
&&form1
select table1
set relation ... into table2
&& call form2
If you choose to print the report, a query is run to pull the matching records into a cursor and the report is printed from based on the cursor.
The problem that I'm having has to do with the change of the active table. When I print the report the cursor is created and selected however sometimes I get an error that it can't find one of the fields in the report because the table that is actually selected isn't the report cursor. This is odd because prior to actually issuing the "report form" command I check the currently selected table and it is correct. But once I issue "report form" the selected table is changes to the first table I opened and not the report cursor.
The report data environment is empty and the report NOT running in a private data session. The code to run the report is as follows:
selece *... into cursor myCursor
Select MyCursor
report form ....
use in myCursor
Any ideas or suggestions would be greatly appreciated.