>local lnOldWorkArea >lnOldWorkArea = select() >set reportbehavior 80 > >select ledger.*, tip.st_name, sponsor_id,getRTAElementNumber(sponsor_id) as ID1,; > asc(left(GetRTAElementSuffix(sponsor_id),1)) + asc(substr(GetRTAElementSuffix(sponsor_id),2,1)) as ID2, ; > element, subElement ; > from tip ; > left join ledger ; > on tip.tip_id = ledger.tip_id ; > inner join rta_basedata ; > on tip.tip_id = rta_basedata.tip_id ; > where 'RTA'$sponsor_id and source='RTA' ; > order by ID1,ID2 ; > into cursor crsTemp > >report form rta_financial_summary to printer prompt preview noconsole > >use in crsTemp >select(lnOldWorkArea) >>The code works fine with no trouble if it is highlighted and executed from the code window. However when run from the menu during program execution, it will bring up the preview of the first page of the report and then error when navigating to subsequent pages. The error says 'Variable "Element" is not found.' "Element" is a field in the cursor and is printed in the report and is used for grouping in the report. Any idea what gives and why it would work in one instance and not the other?