-- 作者:wwwzhucom
-- 发布时间:2014/2/28 16:35:00
-- 多个条件查询
在分页加载的时候,怎么不能按多个查询条件查询啊,不知道哪里出现了问题,请大家帮下忙找下原因,主要是不显示查询的结果;
查询按钮的代码如下:
Dim txtCXgonghao As WinForm.TextBox txtCXgonghao=e.Form.Controls("txtCXgonghao") Dim txtCXName As WinForm.TextBox txtCXName=e.Form.Controls("txtCXName") Dim cbxCXDepartment As WinForm.ComboBox cbxCXDepartment=e.Form.Controls("cbxCXDepartment") Dim txtCXCharing As WinForm.TextBox txtCXCharing=e.Form.Controls("txtCXCharing") Dim lblCount As WinForm.Label lblCount=e.Form.Controls("lblCount")
Vars("Filter")=" " Dim strFilter As String=Vars("Filter")
If txtCXgonghao.Value IsNot Nothing Then strFilter="工号=" & txtCXgonghao.Value & " " End If
If txtCXName.Value IsNot Nothing Then If strFilter.trim.length>0 Then strFilter+="And" & " " End If strFilter+="姓名 like \'% " & txtCXName.Value & " %\'" & " " End If
If cbxCXDepartment.Value IsNot Nothing Then If strFilter.trim.length>0 Then strFilter+="And" & " " End If strFilter+="部门 like \'% " & cbxCXDepartment.Value & " %\'" & " " End If
If txtCXCharing.Value IsNot Nothing Then If strFilter.trim.length>0 Then strFilter+="And" & " " End If strFilter+="充电位=" & txtCXCharing.Value & " " End If
Vars("Filter")=strFilter
With DataTables("人员信息") If Vars("Filter")<>"" Then .LoadFilter=Vars("Filter") Else .LoadFilter="" End If .LoadTop=35 .LoadPage=0 .Load() lblCount.Text="当前第1页/共" & .TotalPages & "页" End With
|