Dim Filter As String
With e.Form.Controls("DateTimePicker1")
If .value IsNot Nothing Then
Filter="日期 = #" & .Value & "#"
End If
End With
With e.Form.Controls("TextBox1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "收入 = '" & .Value & "'"
End If
End With
With e.Form.Controls("TextBox2")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "支出 = '" & .Value & "'"
End If
End With
With e.Form.Controls("TextBox3")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "余额 = '" & .Value & "'"
End If
End With
With e.Form.Controls("TextBox4")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "说明 like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TextBox5")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "经手人 Like '%" & .Value & "%'"
End If
End With
If Filter > "" Then
Tables("收付款帐户_Table1").Filter = Filter
End If
加上日期又不对了。