vfp中如何动态改变表格控件的数据源
SELECT wczsdthisform.text2.Value=STR(RECCOUNT())
SELECT * FROM sqjbqk LEFT JOIN wczsd ON sqjbqk.sqmc=wczsd.sqmc AND sqjbqk.jxmc=wczsd.jxmc AND sqjbqk.mphm=wczsd.mphm INTO CURSOR temp
SELECT * FROM temp WHERE dcsj is NOT NULL INTO CURSOR temp1
SELECT * FROM temp WHERE dcsj is NULL INTO CURSOR temp2
brow
SELECT temp1
thisform.text1.value=STR(RECCOUNT())
thisform.grid1.RecordSourceType= 1
thisform.grid1.RecordSource='temp1'
SELECT temp2
thisform.text3.Value=STR(RECCOUNT())
thisform.grid2.RecordSourceType= 1
thisform.grid2.RecordSource='temp2'
thisform.grid1.Visible= .T.
thisform.grid2.Visible= .T.
thisform.grid1.Refresh
thisform.grid2.Refresh
brow能显示查询结果,但表格控件中不能显示正确结果,都显示的是sqjbqk中的四个字段的值,没有wczsd表中的字段的值。请高手指教,谢谢!