Dim Filter As String
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
Filter = "日期 >= #" & .Value & "# "
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And " '相\在原条件基础上添加 and
End If
Filter = Filter & "日期 <= #" & .Value & "# " '添加下一个条件
End If
End With
Dim drs1 As List(Of DataRow)
Dim drs2 As List(Of DataRow)
Dim day_delay As Integer = e.Form.Controls("NumericComboBox1").Value
Dim number_delay As Integer = e.Form.Controls("NumericComboBox2").Value
drs1 = DataTables("故障报告").Select(Filter)