Foxtable(狐表)用户栏目专家坐堂 → [求助]筛选检查框选中的行,并输出


  共有1992人关注过本帖平板打印复制链接

主题:[求助]筛选检查框选中的行,并输出

美女呀,离线,留言给我吧!
zileiquan88
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:21 积分:234 威望:0 精华:0 注册:2017/10/18 8:30:00
[求助]筛选检查框选中的行,并输出  发帖心情 Post By: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


 回到顶部
总数 23 1 2 3 下一页