VFP生成的文件最好是存在自建的文件夹内
坚守VFP最后的阵地
*--- 添加按钮代码 SELECT SHLR IF RECCOUNT("SHLR")<=0 INSERT INTO SHLR (CLBH) VALUES ("合 计") ENDIF GO BOTTOM INSERT BEFORE BLANK && 在最后一条记录前插入一条空白记录 GO RECCOUNT()-1 FOR I=1 TO FCOUNT() &&添加新记录 TEXT="TEXT"+TRANSFORM(I) REPLACE (FIELD(I)) WITH THISFORM.&TEXT..VALUE ENDFOR IF RECCOUNT("SHLR")>1 SELECT "合 计" AS CLBH,SPACE(20) AS CLMC,SUM(CLDJ) AS CLDJ FROM SHLR WHERE BETWEEN(RECNO(),1,RECCOUNT()-1) INTO ARRAY SJ_SUM SELECT SHLR GO BOTTOM GATHER FROM SJ_SUM ENDIF RELEASE SJ_SUM THISFORM.GRID1.REFRESH thisform.refresh thisform.text1.setfocus thisform.text1.value='' thisform.text4.value='' thisform.text5.value=''
*--- “添加”CLICK 事件代码 SELECT SHLR IF RECCOUNT("SHLR")<=0 INSERT INTO SHLR (CLBH) VALUES ("合 计") ENDIF GO BOTTOM INSERT BEFORE BLANK && 在最后一条记录前插入一条空白记录 GO RECCOUNT()-1 FOR I=1 TO FCOUNT() TEXT="TEXT"+TRANSFORM(I) REPLACE (FIELD(I)) WITH THISFORM.&TEXT..VALUE ENDFOR IF RECCOUNT("SHLR")>1 SELECT "合 计" AS CLBH,SPACE(20) AS CLMC,00000.00 AS CLDJ,SUM(SL) AS SL FROM SHLR WHERE BETWEEN(RECNO(),1,RECCOUNT()-1) INTO ARRAY SJ_SUM SELECT SHLR GO BOTTOM GATHER FROM SJ_SUM ENDIF RELEASE SJ_SUM *--- 表格 INIT 事件代码 THISFORM.SETALL("FORMAT","Z","COLUMN")