Foxtable(狐表)用户栏目专家坐堂 → [求助]


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

主题:[求助]

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


加好友 发短信
等级:幼狐 帖子:92 积分:824 威望:0 精华:0 注册:2017/11/23 8:55:00
[求助]  发帖心情 Post By:2018/8/14 10:07:00 [只看该作者]

选择下次检定日期查询时排除运维状态列内容是"检定"的行。。。这个代码不知怎么写了,请老师帮助。

 

Dim Val As WinForm.ComboBox = e.Form.Controls("boBoox")

Dim tex As WinForm.TextBox = e.Form.Controls("TexFind")

Dim str As String = tex.text

Dim stm As String = Val.Value

Dim ksrq As WinForm.DateTimePicker = e.Form.Controls("StartDate")

Dim jsrq As WinForm.DateTimePicker = e.Form.Controls("EndDate")

Dim Filter As String = "1=1"

Select Case stm

    Case "器具名称"

        Tables("杭康设备总表").filter = "器具名称 like'*" & str & "*'"

        ksrq.Value = Nothing

        jsrq.Value = Nothing

    Case "原编号"

        Tables("杭康设备总表").filter = "原编号 like'*" & str & "*'"

        ksrq.Value = Nothing

        jsrq.Value = Nothing

    Case "型号规格"

        Tables("杭康设备总表").filter = "型号规格 like'*" & str & "*'"

        ksrq.Value = Nothing

        jsrq.Value = Nothing

    Case "出厂编号"

        Tables("杭康设备总表").filter = "出厂编号 like'*" & str & "*'"

        ksrq.Value = Nothing

        jsrq.Value = Nothing

    Case "证书编号"

        Tables("杭康设备总表").filter = "证书编号 like'*" & str & "*'"

        ksrq.Value = Nothing

        jsrq.Value = Nothing

  Case "下次检定日期"

       Tables("杭康设备总表").filter = "[运维状态] NOT =  '检定'"

        If ksrq.Value IsNot Nothing Then

            Filter = Filter & " and 下次检定日期 >= #" & ksrq.Value.Date & "#"

        End If

        If jsrq.Value IsNot Nothing Then

            Filter = Filter & " and 下次检定日期 < #" & jsrq.Value.Date.adddays(1) & "#"

        End If

        Tables("杭康设备总表").Filter = filter

        tex.Value = Nothing

    Case "期间核查日期"

        If ksrq.Value IsNot Nothing Then

            Filter = Filter & " and 期间核查日期 >= #" & ksrq.Value.Date & "#"

        End If

        If jsrq.Value IsNot Nothing Then

            Filter = Filter & " and 期间核查日期 < #" & jsrq.Value.Date.adddays(1) & "#"

        End If

        Tables("杭康设备总表").Filter = filter

        tex.Value = Nothing

End Select


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/8/14 10:24:00 [只看该作者]


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


加好友 发短信
等级:幼狐 帖子:92 积分:824 威望:0 精华:0 注册:2017/11/23 8:55:00
  发帖心情 Post By:2018/8/14 10:34:00 [只看该作者]

因为找不到前面发的贴子,所以又发了,麻烦老师了。谢谢帅哥,在线噢!有点甜老师,已经好了。

 回到顶部