以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 当日查询 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=89409) |
-- 作者:yzyend -- 发布时间:2016/8/21 11:40:00 -- 当日查询 查询窗口,设置一按钮,按钮代码如下: e.form.Controls("DateTimePicker1").Value =Date.Today() e.form.Controls("combobox1").Value = "湖南公司" Dim Filter As String With e.Form.Controls("combobox1") If .Value IsNot Nothing Then Filter = "销售单位 = \'" & .Value & "\'" End If End With With e.Form.Controls("datetimepicker1") If .Value IsNot Nothing Then Filter = "销售日期 = \'" & .Value & "\'" End If End With If Filter > "" Then Tables("销售单").Filter = Filter End If 为什么 查询的结果是所有公司 当日的销售? 销售单位没有起作用哦! 帮我看看!
|
-- 作者:cbt -- 发布时间:2016/8/21 12:09:00 -- Filter = filter & " and 销售日期 = \'" & .Value & "\'" |
-- 作者:大红袍 -- 发布时间:2016/8/21 13:39:00 -- e.form.Controls("DateTimePicker1").Value =Date.Today() e.form.Controls("combobox1").Value = "湖南公司" Dim Filter As String = "1=1" With e.Form.Controls("combobox1") If .Value IsNot Nothing Then Filter &= " and 销售单位 = \'" & .Value & "\'" End If End With With e.Form.Controls("datetimepicker1") If .Value IsNot Nothing Then Filter &= " and 销售日期 = \'" & .Value & "\'" End If End With If Filter > "" Then Tables("销售单").Filter = Filter End If |