Dim filter1 As String = "1=1"
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
filter1 = filter1 & " and 第六列 >= '" & .Value & "'"
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
filter1 = filter1 & " and 第六列 <= '" & .Value & "'"
End If
End With
Dim filter2 As String = "1=1"
With e.Form.Controls("combobox1")
If .Value IsNot Nothing Then
filter2 = Filter2 & " And 第2列 = '" & .Value & "'"
If.Value="全部类别" Then
Filter2=Filter2 & " And 第2列 = " "
End If
End With
With e.Form.Controls("combobox2")
If .Value IsNot Nothing Then
filter2 = filter2 & " and 第1列 = '" & .Value & "'"
If.Value="全市" Then
Filter2=filter2& " and 第1列 = " "
End If
End With
DataTables("表A").LoadFilter = "第4列 not in (select isnull(第七列, '') from {表B} where " & filter1 & ") and " & filter2
DataTables("表A").Load