Dim Filter As String
With e.Form.Controls("CheckedComboBox2")
If .Value IsNot Nothing Then
Filter = "所属省份 in ('" & .Value.Replace(",", "','") & "')"
End If
End With
With e.Form.Controls("CheckedComboBox1")
If .Value IsNot Nothing Then
Filter = "项目类型 In ('" & .Value.Replace(",", "','") & "')"
End If
End With
With e.Form.Controls("TextBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "施工区域 = '" & .Value & "'"
End If
End With
With e.Form.Controls("TextBox1")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "最大承载力KN >= '" & .Value & "'"
End If
End With
With e.Form.Controls("TextBox3")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "最深桩长m >= '" & .Value & "'"
End If
End With
With e.Form.Controls("TextBox4")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "最大桩径mm >= '" & .Value & "'"
End If
End With
With e.Form.Controls("TextBox5")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "基坑深度m >= '" & .Value & "'"
End If
End With
With e.Form.Controls("NumericComboBox1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "工程造价 >= '" & .Value & "'"
End If
End With
With e.Form.Controls("StartDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "开工日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("EndDate")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "竣工日期 <= #" & .Value & "#"
End If
End With
If e.Form.Controls("在建工程").Checked = True ' 如果选择了"在建工程"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "竣工日期 >= #" & Date.Today & "#"
End If
If Filter > "" Then
Tables("工程技术参数").DataTable.LoadTop = Nothing
Tables("工程技术参数").DataTable.LoadFilter = ""
Tables("工程技术参数").DataTable.Load
End If
Dim t As Table = Tables("工程技术参数")
Dim n As Integer = t.DataTable.GetValues("合同编号", t.filter).count
Dim lbl As WinForm.Label
lbl = e.Form.Controls("Label5")
lbl.Text = "符合条件工程数:" & n & "个," & "记录数:" & Tables("工程技术参数").Rows.Count & "条."