以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 窗口复合查询代码问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=97490) |
||||
-- 作者:feixianzhi -- 发布时间:2017/3/13 15:11:00 -- 窗口复合查询代码问题
现在默认的是按商品名称查询批发表和入库表,我想实现:当商品单价被选中时,那么按商品名称+商品单价查询;当商品单价、供应商名称选中时,那么就按商品名称+商品单价+供应商名称查询。依此类推,请各位老师帮忙,代码怎么写。
|
||||
-- 作者:feixianzhi -- 发布时间:2017/3/13 15:31:00 -- 请有点蓝老师帮忙呀。 |
||||
-- 作者:有点蓝 -- 发布时间:2017/3/13 16:26:00 -- if e.form.controls("商品单价").checked = true \'拼凑按商品名称+商品单价查询的条件 elseif if e.form.controls("供应商名称").checked = true \'拼凑按商品名称+商品单价+供应商名称的条件 ......
拼凑条件参考:http://www.foxtable.com/webhelp/scr/1058.htm
|
||||
-- 作者:feixianzhi -- 发布时间:2017/3/13 16:32:00 -- 有点蓝老师,代码放哪里呀。 |
||||
-- 作者:feixianzhi -- 发布时间:2017/3/13 16:53:00 --
有点蓝老师,我改了一下,把复选框去掉了,做了一个按钮,按钮代码如下:
Dim Filter As String
但我点按钮,批发表和入库表均没有反应,是代码有问题吧,请老师帮忙。 |
||||
-- 作者:有点蓝 -- 发布时间:2017/3/13 17:21:00 -- Filter = Filter & "客户名称 = \'" & .Value & "\'"
Filter = Filter & "进价 = \'" & .Value & "\'"
|
||||
-- 作者:feixianzhi -- 发布时间:2017/3/13 22:55:00 -- Dim Filter As String With e.Form.Controls("TextBox商品名称") If .Value IsNot Nothing Then Filter = "商品名称 = \'" & .Value & "\'" End If End With With e.Form.Controls("TextBox客户名称") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "客户名称 = \'" & .Value & "\'" End If End With With e.Form.Controls("TextBox进价") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "进价 = \'" & .Value & "\'" End If End With 有点蓝老师,我把代码改成这样,还是没有反应,是不是需要指定哪个表呀。
|
||||
-- 作者:feixianzhi -- 发布时间:2017/3/14 7:41:00 --
有点蓝老师,我想实现:商品编码、供应商编码、客户编码、进价、单据开始日期、单据结束日期,这六个条件,任意输入,则点筛选按钮,则入库表和批发表同时按相关条件进行筛选。
我写了按钮代码,但没有反应,不知道错在哪里,请有点蓝老师帮忙。代码如下:
Dim Filter As String With e.Form.Controls("客户编码") With e.Form.Controls("单据开始日期") |
||||
-- 作者:有点蓝 -- 发布时间:2017/3/14 8:55:00 -- 既然知道要指定表,那就指定测试一下就知道咯
e.Form.Controls("批发表").Table.Filter = Filter |
||||
-- 作者:feixianzhi -- 发布时间:2017/3/14 10:36:00 -- 有点蓝老师,这个代码放在哪呀。 |