... SELECT LettersForThisPatient report form ViewReferralLetter preview ...BTW, the number of records returned by SELECT statement is stored into _TALLY global system variable.
SELECT ... FROM ... IF _TALLY = 0 * No records returned ...>Hi all:
if !empty(mHealthCard) > select * from referal_to into cursor LettersForThisPatient nofilter; > where referal_to.hlth_card = mHealthCard; > order by referal_to.refer_date >endif > >* First see if there is any data in the cursor >* If there is data, then do the report ViewReferralLetter, else >* tell the user that there is no data avaiable. > >count to gaga >if gaga = 0 > do form not_find >else > * Select the field required to display the clinic information on the report and > * store that information into a cursor. > select clnc_name, address2, address22,; > alltrim(proper(city))+", "+alltrim(upper(Province))+" "+ alltrim(PostalCode) as CityProvcode,; > alltrim(str(area_phone))+" "+alltrim(str(phone)) as telephone,; > alltrim(str(area_fax))+" "+alltrim(str(facsimile)) as faxnumber; > from clinic into cursor clinicinfo nofilter > report form ViewReferralLetter preview >endif>