Foxtable(狐表)用户栏目专家坐堂 → 过产品编号查询 时间(起始和结束)??


  共有2214人关注过本帖树形打印复制链接

主题:过产品编号查询 时间(起始和结束)??

帅哥哟,离线,有人找我吗?
zch1104
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:58 积分:496 威望:0 精华:0 注册:2016/4/11 18:05:00
过产品编号查询 时间(起始和结束)??  发帖心情 Post By: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
图片点击可在新窗口打开查看

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By: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


 回到顶部