cthecodigo = ALLTRIM(THISFORMSET.form1.pageframe1.page1.label15.CAPTION) SELECT a.EXPEDIENTE,IIF(a.GENERO=1,"M", "H") AS a_sexo, ; a.nom1_tit, a.nom2_tit, a.apel1_tit, a.apel2_tit, a.apec_tit, ; b.nombre AS canton, ; c.nombrec AS caserio, ; IIF(a.ingre_ficreg,1,0) AS Ingre_ficre, ; IIF(a.ingre_cip,1,0) AS ingre_cip,; IIF(a.ingre_dui,1,0) AS ingre_dui,; IIF(a.ingre_titulo,1,0) AS ingre_titu ; FROM maestra a, canton b, caserios c ; NOFILTER ; WHERE a.codcanton=b.cod_canton AND a.codcase= c.cod_caser ; AND a.EXPEDIENTE = cthecodigo; INTO TABLE TMPFICHA IF _TALLY#0 SELECT TMPFICHA REPORT FORM c:\SOURCERES\SISCSEH\Reports\rep_hoja_recexpedx ; PREVIE ELSE =MESSAGEBOX("No data to show for "+cthecodigo+",0+16+256,"No data") ENDIF