grid的问题

loveno1 2003-08-23 09:15:52
我在一个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
...全文
98 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
pecker 2003-08-24
  • 打赏
  • 举报
回复
加上这两句:
thisform.grid1.recordsourcetype="table"
thisform.grid1.recordsource="temp"
thisform.grid1.refresh

loveno1 2003-08-24
  • 打赏
  • 举报
回复
楼上2位的方法,我原来都已经试过了,不可以啊。

用go top, go recno(),Grid会出现会出现2条一样的,我刚刚输入的记录。 急死了

我的Recordsource是在Grid的属性里就设定好的

谢谢了,各位,再帮帮忙啊~~~
fj_jiangqi 2003-08-24
  • 打赏
  • 举报
回复
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是怎么设置的?
-------------------------
我流落在凄凉的世界里-孤苦伶仃
我过着动荡无助的生活-四处漂泊
mgan 2003-08-24
  • 打赏
  • 举报
回复
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
试试 看
不止到可以不可以啊
loveno1 2003-08-24
  • 打赏
  • 举报
回复
我的问题还是没有解决,哪位高手帮帮忙啊....急......

谢谢
fj_jiangqi 2003-08-23
  • 打赏
  • 举报
回复
set talk off
select tmp

append blank
replace 用途 with thisform.combo1.value
...
replace 备注 with thisform.edit1.value
sum all 金额 to s
skip -1
thisform.label7.caption=str(s)
thisform.grid1.refresh
在sum后加一个skip -1试试看。
我想不是数据没有,也许是因为用了sum记录移到表未,造成看不到而已。
猜测中,也许错了……
-------------------------
我流落在凄凉的世界里-孤苦伶仃
我过着动荡无助的生活-四处漂泊
mgan 2003-08-23
  • 打赏
  • 举报
回复
SET TALK ON | OFF | WINDOW [WindowName] | NOWINDOW

参数
ON

(默认值)允许把对话结果发送到 Visual FoxPro 主窗口、系统信息窗口、图形状态栏、或用户自定义窗口中。如果 SET TALK 设置为 OFF 后再改为 ON,那么对话结果将传送到发出 SET TALK OFF 命令之前的输出位置。

OFF

阻止对话结果传送到 Visual FoxPro 主窗口、系统信息窗口、图形状态栏、或用户自定义窗口中。



知道 错在那里了把 ?

2,722

社区成员

发帖
与我相关
我的任务
社区描述
VFP,是Microsoft公司推出的数据库开发软件,用它来开发数据库,既简单又方便。
社区管理员
  • VFP社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧