If Forms("记账确认").Opened Then
Dim rqsr As WinForm.DateTimePicker = e.Form.Controls("日期输入")
Dim rq As String = rqsr.Value
Dim sz As String = e.Sender.Value
Dim jesr As WinForm.TextBox = e.Form.Controls("金额输入")
Dim je As Double = jesr.Value
If rq Is Nothing And sz Is Nothing And je = 0 Then
Tables("日记账").Filter = ""
ElseIf rq IsNot Nothing And sz Is Nothing And je = 0 Then
Tables("日记账").Filter = "[日期] = '" & rq & "'"
ElseIf rq Is Nothing And sz = "收入" And je = 0 Then
Tables("日记账").Filter = "[收入] is not null"
ElseIf rq Is Nothing And sz = "支出" And je = 0 Then
Tables("日记账").Filter = "[支出] is not null"
ElseIf rq Is Nothing And sz Is Nothing And je <> 0 Then
Tables("日记账").Filter = "[收入] = '" & je & "' or [支出] = '" & je & "'"
ElseIf rq IsNot Nothing And sz = "收入" And je = 0 Then
Tables("日记账").Filter = "[日期] = '" & rq & "' and [收入] is not null"
ElseIf rq IsNot Nothing And sz = "支出" And je = 0 Then
Tables("日记账").Filter = "[日期] = '" & rq & "' and [支出] is not null"
ElseIf rq IsNot Nothing And sz Is Nothing And je <> 0 Then
Tables("日记账").Filter = "[日期] = '" & rq & "' and [收入] = '" & je & "' or [日期] = '" & rq & "' and [支出] = '" & je & "'"
ElseIf rq Is Nothing And sz = "收入" And je <> 0 Then
Tables("日记账").Filter = "[收入] = '" & je & "'"
ElseIf rq Is Nothing And sz = "支出" And je <> 0 Then
Tables("日记账").Filter = "[支出] = '" & je & "'"
ElseIf rq IsNot Nothing And sz = "收入" And je <> 0 Then
Tables("日记账").Filter = "[日期] = '" & rq & "' and [收入] = '" & je & "'"
ElseIf rq IsNot Nothing And sz = "支出" And je <> 0 Then
Tables("日记账").Filter = "[日期] = '" & rq & "' and [支出] = '" & je & "'"
End If
End If