以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  过产品编号查询 时间(起始和结束)??  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=89222)

--  作者:zch1104
--  发布时间:2016/8/17 14:29:00
--  过产品编号查询 时间(起始和结束)??

 

通过产品编号查询 时间(起始和结束),下列代码问题出在哪?还有通过产品编号查询后的产品中的数量合计代码如何写?谢谢!

 

 

Dim Filter As String

With e.Form.Controls("产品编号")
    If .Value IsNot Nothing Then
        Filter = "TextBox1= \'" & .Value & "\'"
    End If
End With

With e.Form.Controls("StartDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 >= #" & .Value & "#"
    End If
End With
With e.Form.Controls("EndDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 <= #" & .Value & "#"
    End If
End With
If Filter > "" Then
    Tables("销售出库明细").Filter = Filter
End If


图片点击可在新窗口打开查看此主题相关图片如下:截图00.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:截图01.png
图片点击可在新窗口打开查看

--  作者:大红袍
--  发布时间:2016/8/17 14:47:00
--  

Dim Filter As String

With e.Form.Controls("TextBox1")
    If .Value IsNot Nothing Then
        Filter = "产品编号= \'" & .Value & "\'"
    End If
End With