John ,
Why not do this: SELECT COUNT (*) INTO vcount FROM tablename WHERE .. Using the same WHERE clause as the report. Then test the variable vcount; if it is zero, there are no results, otherwise print the report. Note that you do NOT have to pre-define vcount, although it is recommended, and you do NOT need to use an indicator variable there. An aggregate function like COUNT will never return NULL. Emmitt Dove Manager, Converting Applications Development Evergreen Packaging, Inc. [email protected] (203) 214-5683 m (203) 643-8022 o (203) 643-8086 f [email protected] From: [email protected] [mailto:[email protected]] On Behalf Of John Engwer Sent: Friday, July 17, 2009 2:33 PM To: RBASE-L Mailing List Subject: [RBASE-L] - Using the ERROR VARIABLE I have run into a problem when I try to use the error variable to trap errors when printing a report. Here is what my code looks like. SET ERROR VARIABLE vErrVar Print report... where .. (if the where clause is not satisfied vErrVar should change to 2038) IF vErrVar <> 0 then Display message that no items exist.. ENDIF RETURN This is used to report the results of a search. If the operator enters search criteria where there is no match the operator should get a message that the search failed. If error messages are turned on, a 2038, no rows found is displayed but vErrVar has a value of 0 instead of the expected 2038. Does anyone know what I may be doing wrong? John

