以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 控件上是字符数组,如何实现筛选加载 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=179215) |
-- 作者:采菊东篱下 -- 发布时间:2022/8/12 20:35:00 -- 控件上是字符数组,如何实现筛选加载 无法上传图片,只能手动输入: ComboBox1控件上的效果是这样的,要实现筛选加载: 月租停车 月租停车-业主月租停车 月租停车-租户月租停车 月租停车-外来月租停车 临时停车 临时停车-亲情临时停车 临时停车-外来临时停车 铺位租金 广告或其他 这样写只实现到一级筛选,无法实现二级筛选: Dim Filter As String With e.Form.Controls("ComboBox1") If .Value IsNot Nothing Then Dim Parts() As String = .Value.Split("-") If Parts(0) IsNot Nothing Then Filter = "分类 = \'" & Parts(0) & "\'" ElseIf Parts(1) IsNot Nothing Then If Filter > "" Then Filter = Filter & " Or " End If Filter = Filter & "明细分类 = \'" & Parts(1) & "\'" End If End If End With With e.Form.Controls("DateTimePicker1") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "Year(日期) = \'" & Year(.Value) & "\'And Month(日期) = \'" & Month(.Value) & "\'" End If End With With e.Form.Controls("DropBox1") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "车牌号码 = \'" & .Value & "\'" End If End With With DataTables("安缴费日期查询_Table1") If Filter > "" Then LockBaseMainForm() \'锁定主界面 .StopRedraw() .LoadFilter = Filter .LoadOrder = "日期,单号,[_SortKey] DESC" For i As Integer = DataTables("缴费情况").DataRows.count - 1 To 0 Step -1 Dim tr As DataRow = DataTables("缴费情况").DataRows(i) If tr.IsNull("日期") Then tr.delete End If Next .Load() .ResumeRedraw() UnLockBaseMainForm() \'解锁主界面 End If If .DataRows.Count < 15 Then .AddNew(15 - .DataRows.Count) End If End With
[此贴子已经被作者于2022/8/12 20:50:03编辑过]
|
-- 作者:有点蓝 -- 发布时间:2022/8/13 9:26:00 -- Dim Filter As String With e.Form.Controls("ComboBox1") If .Value IsNot Nothing Then Dim Parts() As String = .Value.Split("-") Filter = "分类 = \'" & Parts(0) & "\'" If Parts.length > 1 Then Filter = "(" & Filter & " or 明细分类 = \'" & Parts(1) & "\')" End If End If End With
|
-- 作者:采菊东篱下 -- 发布时间:2022/8/13 10:09:00 -- 不行依然只加载到一级筛选数,如果改为如下,则完全没加载数据: Dim Filter As String With e.Form.Controls("ComboBox1") If .Value IsNot Nothing Then Dim Parts() As String = .Value.Split("-") Filter = "分类 = \'" & Parts(0) & "\'" If Parts.length > 1 Then Filter = "(" & Filter & " And 明细分类 = \'" & Parts(1) & "\')" End If End If End With With e.Form.Controls("DateTimePicker1") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "Year(日期) = \'" & Year(.Value) & "\'And Month(日期) = \'" & Month(.Value) & "\'" End If End With With e.Form.Controls("DropBox1") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "车牌号码 = \'" & .Value & "\'" End If End With With DataTables("安缴费日期查询_Table1") If Filter > "" Then LockBaseMainForm() \'锁定主界面 .StopRedraw() .LoadFilter = Filter .LoadOrder = "日期,单号,[_SortKey] DESC" For i As Integer = DataTables("缴费情况").DataRows.count - 1 To 0 Step -1 Dim tr As DataRow = DataTables("缴费情况").DataRows(i) If tr.IsNull("日期") Then tr.delete End If Next .Load() .ResumeRedraw() UnLockBaseMainForm() \'解锁主界面 End If If .DataRows.Count < 15 Then .AddNew(15 - .DataRows.Count) End If End With [此贴子已经被作者于2022/8/13 10:11:18编辑过]
|
-- 作者:有点蓝 -- 发布时间:2022/8/13 10:16:00 -- 没有符合条件的数据 msgbox(Filter)
|
-- 作者:采菊东篱下 -- 发布时间:2022/8/13 11:30:00 -- 弹出: (分类= \'月租停车\' And 明细分类 = \'业主月租停车\') And Year(日期)=\'2020\' And Month(日期) = \'12\' 表里一定有当期数据的。
|
-- 作者:采菊东篱下 -- 发布时间:2022/8/13 12:05:00 -- 改为这样还是没任何数据显示: Dim Filter As String With e.Form.Controls("ComboBox1") If .Value IsNot Nothing Then Dim Parts() As String = .Value.Split("-") Filter = "分类 = \'" & Parts(0) & "\'" If Parts.length > 1 Then Filter = Filter & " And 明细分类 = \'" & Parts(1) & "\'" End If End If End With With e.Form.Controls("DateTimePicker1") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "Year(日期) = " & Year(.Value) & " And Month(日期) = " & Month(.Value) End If End With With e.Form.Controls("DropBox1") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "车牌号码 = \'" & .Value & "\'" End If End With msgbox(Filter) With DataTables("安缴费日期查询_Table1") If Filter > "" Then LockBaseMainForm() \'锁定主界面 .StopRedraw() .LoadFilter = Filter .LoadOrder = "日期,单号,[_SortKey] DESC" For i As Integer = DataTables("缴费情况").DataRows.count - 1 To 0 Step -1 Dim tr As DataRow = DataTables("缴费情况").DataRows(i) If tr.IsNull("日期") Then tr.delete End If Next .Load() .ResumeRedraw() UnLockBaseMainForm() \'解锁主界面 End If If .DataRows.Count < 15 Then .AddNew(15 - .DataRows.Count) End If End With |
-- 作者:有点蓝 -- 发布时间:2022/8/13 14:13:00 -- 肯定没有符合这个条件的数据 |
-- 作者:采菊东篱下 -- 发布时间:2022/8/13 14:42:00 -- 有: 日期 分类 明细分类 用户性质 序号 巷 号 房 姓名 固定电话 手机号码 车牌号码 前缀 单号 起计时间 止计时间 缴费月数 月租单价 缴费金额
2020-12-23 月租停车
业主月租停车 业主
8 八巷 5
607 李生
2222222 12345678911 粤JB8888W
YZ YZ-202012-00005 2021-01-01
2021-03 - 31
3
80
240 |
-- 作者:采菊东篱下 -- 发布时间:2022/8/13 14:44:00 -- ,你们的论坛复制上来的数据全乱了,图片也不让上传! |
-- 作者:采菊东篱下 -- 发布时间:2022/8/13 14:46:00 -- 下面的数据是同一行的,没法编辑!乱!你点编辑看吧,编辑分两行,发出后变成这样! |