--
Dim Filter As String
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
Filter = "工作单位 = \'" & .Value & "\'"
End If
End With
With e.Form.Controls("ComboBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "检查类别 = \'" & .Value & "\'"
Else
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "检查类别 <> \'复查\'"
End If
End With
With e.Form.Controls("CheckedComboBox1")
If .value IsNot Nothing Then
Dim Ft As String
Dim Vals() As String = .Value.Split(",")
For Val As Integer = 0 To Vals.Length - 1
Ft + = ",\'" & Vals(Val) & "\'"
Next
If ft > "" Then
Filter = "车间 In (" & Ft.Trim(",") & ")"
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 & "体检日期 >= \'" & .Value & "\'"
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "体检日期 <= \'" & .Value & "\'"
End If
End With
[此贴子已经被作者于2022/12/20 11:22:54编辑过]