我在一个form里添加了一个grid是和一个表绑定在一起的,这个 form还有一些textbox,是一些要向grid添加数据的.确定以后,希望达到的效果是加了一条数据,
grid就可以多出这条数据,可是现在grid里并没有多出来,反而数据都没有了,希望高手帮忙解决,代码如下
set talk off
select tmp
append blank
replace 用途 with thisform.combo1.value
replace 金额 with val(thisform.text1.value)
replace 用途 with thisform.combo1.value
replace 日期 with ctod(thisform.text2.value)
replace 备注 with thisform.edit1.value
sum all 金额 to s
thisform.label7.caption=str(s)
thisform.grid1.refresh
set talk off
select tmp
append blank
replace 用途 with thisform.combo1.value
...
replace 备注 with thisform.edit1.value
sum all 金额 to s
go top
thisform.label7.caption=str(s)
thisform.grid1.refresh
试试 看
不止到可以不可以啊
append blank
replace 用途 with thisform.combo1.value
...
replace 备注 with thisform.edit1.value
rn=recno()
sum all 金额 to s
go rn
thisform.label7.caption=str(s)
thisform.grid1
.refresh
在sum后加一个数据定位在追加的那条记录上试试看。
想不出错误的理由,唉!我该去读书了……
不知thisform.grid1里的Recordsourcetype,Recordsource是怎么设置的?
-------------------------
我流落在凄凉的世界里-孤苦伶仃
我过着动荡无助的生活-四处漂泊
加上这两句:
thisform.grid1.recordsourcetype="table"
thisform.grid1.recordsource="temp"
thisform.grid1.refresh