Dim Filter As String = "1=1"
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
Filter = Filter & " and 第六列 >= '" & .Value & "'"
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
Filter = Filter & " and 第六列 <= '" & .Value & "'"
End If
End With
With e.Form.Controls("combobox1")
If .Value IsNot Nothing Then
Filter = " and 第2列 = '" & .Value & "'"
End If
End With
With e.Form.Controls("combobox2")
If .Value IsNot Nothing Then
Filter = Filter & " and 第1列 = '" & .Value & "'"
End If
End With
DataTables("表A").LoadFilter = "第4列 not in (select isnull(第七列, '') from {表B} where " & filter & ")"
DataTables("表A").Load
[此贴子已经被作者于2014-11-30 21:59:39编辑过]