再次请教版主一个问题
小弟我设计一个查询表单要将筛选符合条件的数据以表格形式显示出来
我在一本书上找到一段代码修改了一下作为command的click过程
但是运行老是在where &cxtj into cursor lscanshubiao显示
“不能识别的命令谓词”
麻烦请版主指导一下该怎么修改
private cxtj
if empty(thisform.combo1.displayvalue)or empty(thisform.combo2.displayvalue)or empty(thisform.text1.value)
wait windows'请输入完整条件!'
thisform.combo1.setfocus
else
do case
case alltrim(thisform.combo1.displayvalue)='给料粒度'
cxtj=alltrim(thisform.combo1.displayvalue)+''+alltrim(thisform.combo2.displayvalue)+''+alltrim(thisform.text1.value)
case alltrim(thisform.combo1.displayvalue)='给料能力'
cxtj=alltrim(thisform.combo1.displayvalue)+''+alltrim(thisform.combo2.displayvalue)+''+alltrim(thisform.text1.value)
otherwise
cxtj=alltrim(thisform.combo1.displayvalue)+''+alltrim(thisform.combo2.displayvalue)+'"'+alltrim(thisform.text1.value)+'"'
endcase
select*from canshubiao
where &cxtj into cursor lscanshubiao
thisform.grid1.recordsource='lscanshubiao'
thisform.grid1.backcolor=rgb(200,224,248)
endif
这几个的运行结果是什么? 书上是这么写的
我也不是太清楚
好像是给宏赋值吧 把select*from canshubiao
改成select*from canshubiao;(仅仅是加个分号)
明白为什么了吗?不明白的话就好好看看书。 修改以后运行时在
select*from canshubiao;
提示"操作符/操作数类型不匹配"又是怎么回事啊 select*from改成select * from (加空格试试)
连接的结果赋值个变量
[quote][bo]以下是引用 [un]wzxc[/un] 在 2008-5-17 20:01 的发言:[/bo]cxtj=alltrim(thisform.combo1.displayvalue)+''+alltrim(thisform.combo2.displayvalue)+''+alltrim(thisform.text1.value)
这几个的运行结果是什么? [/quote]
“alltrim”删除前后空格
“thisform.combo1.displayvalue”列表框或组合框(1)中选定项的第一列的内容
“thisform.combo1.disp2ayvalue”列表框或组合框(2)中选定项的第一列的内容
“thisform.text1.value”文本框中输入的内容
“cxtj=”连接的结果赋值个变量“cxtj” [quote][bo]以下是引用 [un]啸凡[/un] 在 2008-5-18 16:10 的发言:[/bo]
select*from改成select * from (加空格试试) [/quote]
是我把combo1里的一个字段名写错了
改成和canshubiao里一样后就运行出来了
呵呵!
麻烦版主,再次表示感谢!
页:
[1]
