下面的代码为什么出错呢?请各位指教!

winsonruan 2004-11-23 07:21:04
combo1的interactivechange属性中有如下代码:

with thisform.grid1
.recordsource=''
sele zhucheng
set filt to alltrim(zhucheng.hpdm)==alltrim(thisform.combo1.text)
.recordsource='zhucheng'
.refresh
.setfocus
endwith

执行时经常显示“thisform只能在方法属性中使用”对话框!但是按确定后程序能正常执行!有什么问题呢?请教各位大侠……!


...全文
45 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
dfwxj 2004-11-23
  • 打赏
  • 举报
回复
上面的代码掉了一句,

这里不需要将表格的数据源置空,改一下:

sele zhucheng
set filt to alltrim(zhucheng.hpdm)==alltrim(thisform.combo1.text)
go top &&筛选条件生效
thisform.grid1.refresh
thisform.grid1.setfocus


dfwxj 2004-11-23
  • 打赏
  • 举报
回复
这里不需要将表格的数据源置空,改一下:

sele zhucheng
set filt to alltrim(zhucheng.hpdm)==alltrim(thisform.combo1.text)
thisform.grid1.refresh
thisform.grid1.setfocus
JohnShen 2004-11-23
  • 打赏
  • 举报
回复
set filt to alltrim(zhucheng.hpdm)==alltrim(thisform.combo1.text)
这句估计有问题,修改为:
lcFilter = "alltrim(zhucheng.hpdm)=='" + alltrim(thisform.combo1.text) +"'"
set filt to &lcFilter

2,749

社区成员

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

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