Foxtable(狐表)用户栏目专家坐堂 → [求助]按时段筛选问题


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

主题:[求助]按时段筛选问题

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


加好友 发短信
等级:婴狐 帖子:18 积分:196 威望:0 精华:0 注册:2016/9/26 15:20:00
  发帖心情 Post By:2016/10/10 16:47:00 [显示全部帖子]

在“时间范围”下拉框的ValueChanged事件中写
Dim xz As WinForm.ComboBox = e.Form.Controls("时间范围")
Dim btn1 As WinForm.DateTimePicker = Forms("窗口1").Controls("StartDate")
Dim btn2 As WinForm.DateTimePicker = Forms("窗口1").Controls("EndDate")
If xz.value = "今天"
    Dim y As Integer = Date.Today.Year
    Dim d As Date = Date.Today
    btn1.value = d
    btn2.value = d
    btn1.Enabled = False
    btn2.Enabled = False
End If
在“时间范围”下拉框的TextChanged事件中写
Dim Filter As String

With e.Form.Controls("时间范围")
    Dim xz As WinForm.ComboBox = e.Form.Controls("时间范围")
    If xz.value = "今天"
        Dim y As Integer = Date.Today.Year
        Dim d As Date = Date.Today '当前时间
        Filter = "创建时间 = '" & d & "' And 创建时间 = '" & d & "'"
        Tables("订单管理").Filter = Filter
  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


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


加好友 发短信
等级:婴狐 帖子:18 积分:196 威望:0 精华:0 注册:2016/9/26 15:20:00
  发帖心情 Post By:2016/10/10 16:52:00 [显示全部帖子]

http://www.foxtable.com/webhelp/scr/2720.htm

 回到顶部