Dim Filter As String
With e.Form.Controls("ddbh")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "订单编号 = '" & .Value & "'"
End If
End With
With e.Form.Controls("qs")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "订单日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("jz")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "订单日期 <= #" & .Value & "#"
End If
End With
If Filter > "" Then
Filter = Filter & "某某列 = '" & e.Form.Controls("复选框名称").Checked
Tables("待采购_table1").Filter = Filter
End If
[此贴子已经被作者于2012-8-31 13:00:10编辑过]