Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:按时间段加载问题

1楼
15666282205 发表于:2024/11/19 8:42:00
老师,我用下面的代码实现了按日期时间段显示,是先全部加载再筛选显示;我想实现的是不全部加载,按时间段加载。请您指导。
With DataTables("创新活动表")
.loadtop = Nothing
.loadfilter = ""
.load()
End With
Dim Filter As String

With e.Form.Controls("DateTimePicker1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 >= #" & .Value & "#"
    End If
End With
With e.Form.Controls("DateTimePicker2")
    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

2楼
有点蓝 发表于:2024/11/19 8:58:00
Dim Filter As String

With e.Form.Controls("DateTimePicker1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 >= #" & .Value & "#"
    End If
End With
With e.Form.Controls("DateTimePicker2")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 <= #" & .Value & "#"
    End If
End With

If Filter > "" Then
With DataTables("创新活动表")
.loadtop = Nothing
.loadfilter = Filter
.load()
End With
End If

3楼
cd_tdh 发表于:2024/11/19 8:58:00
Dim Filter As String

With e.Form.Controls("DateTimePicker1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 >= #" & .Value & "#"
    End If
End With
With e.Form.Controls("DateTimePicker2")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 <= #" & .Value & "#"
    End If
End With
With Tables("创新活动表").DataTable
    .LoadFilter = Filter
    .Load()
End With
[此贴子已经被作者于2024/11/19 8:59:14编辑过]
4楼
15666282205 发表于:2024/11/19 10:04:00
多谢两位老师,可以了

共4 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03125 s, 2 queries.