-- 作者:zileiquan88
-- 发布时间:2017/11/2 11:19:00
-- [求助]筛选检查框选中的行,并输出
我建了一个查询窗口,有combox和checkbox,想筛选checkbox被选中的行,和combox中的筛选内容一起输出,这个代码需要怎么改。菜鸟求教!
Dim nms() As String ={"SP_Number","BZ_Name","StartDate","EndDate","SB_Sort1","SB_Sort2","SB_Sort3","SB_Name","SB_Number","WX_Mod"} Dim sps() As String = {"\'","\'","#","#","\'","\'","\'","\'","\'","\'"} Dim bjf() As String = {" = "," ="," >= "," <= "," = "," = "," = "," = "," =" ," = "} Dim fds() As String ={"审批编号","泵站名称","填报日期","填报日期","设备分类_一类","设备分类_二类","设备分类_三类","设备名称","设备编号","维修方式"} Dim Filter As String Dim chk1 As WinForm.CheckBox = e.Form.controls("WX_Maintenance") Dim chk2 As WinForm.CheckBox = e.form.controls("Finished")
For i As Integer = 0 To nms.length - 1 If e.Form.controls(nms(i)).value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & fds(i) & bjf(i) & sps(i) & e.Form.controls(nms(i)).value & sps(i) End If Next With e.Form.Controls("WX_Maintenance") If .value IsNot Nothing Then Filter = Filter & "保养 = \'" & .Value & "\'" End If End With With e.Form.Controls("Finished") If .value IsNot Nothing Then Filter = Filter & "已完成 = \'" & .Value & "\'" End If End With Tables("设备故障情况表").Filter = Filter
|