以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  初学者  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=86325)

--  作者:9876
--  发布时间:2016/6/15 14:31:00
--  初学者
窗口设计查询时,
Dim gys As WinForm.ComboBox = e.Form.Controls("供应商")
Dim spmc As WinForm.ComboBox = e.Form.Controls("商品名称")
Dim ddbh As WinForm.TextBox = e.Form.Controls("订单编号")
Dim sl As WinForm.TextBox = e.Form.Controls("数量")

Tables("订单信息表").Filter="供应商 = \'" & gys.Text & "\' and 商品名称 = \'" & spmc.Text & "\' and 订单编号 = \'*" & ddbh.Text & "*\' and 数量 = \'*" & sl.Text & "*\'"
 
点查询后显示
无法在 System.Int32 和 System.String 上执行“=”操作。图片点击可在新窗口打开查看
图片点击可在新窗口打开查看

--  作者:大红袍
--  发布时间:2016/6/15 15:32:00
--  
Tables("订单信息表").Filter="供应商 like \'%" & gys.Text & "%\' and 商品名称 like \'%" & spmc.Text & "%\' and 订单编号 like \'%" & ddbh.Text & "%\' and Convert(数量,\'System.String\') = \'" & sl.Text & "\'"
--  作者:大红袍
--  发布时间:2016/6/15 15:33:00
--  

 你这种查询有问题,正确的要这样写

 

http://www.foxtable.com/help/topics/1058.htm