With e.Form.Controls("srflDropBox")
If .Value Is Nothing Then
Tables("收入明细窗体_srTable").GrandTotal = False
t = Tables("收入明细窗体_srTable")
removeHandler t.grid.Paint, AddressOf Grid_Paint
Tables("收入明细窗体_srTable").DataSource = DataTables("收支交易流水")
Tables("收入明细窗体_srTable").Filter = "记账日期>= #" & dt1 & "# And 记账日期 <= #" & dt2 & "# And 交易类型 = '收入'"
Tables("收入明细窗体_srTable").SetColVisibleWidth("单号|110|记账日期|90|收支分类原始值|200|收入金额|90|所属账户原始值|150|经手人原始值|90|备注|200")
t = Tables("收入明细窗体_srTable")
t.Cols("收入金额").GrandTotal = True '指定要合计的列
t.GrandTotal = True '显示合计模式
t.Grid.Name = t.Name
AddHandler t.grid.Paint, AddressOf Grid_Paint
End If
Dim drr As DataRow = DataTables("收入分类").find("收入目录='" & .Value & "'")
If drr IsNot Nothing Then
Dim str As String = DataTables("收入分类").GetComboListString("收入目录","收入分类代码='" & drr("收入分类代码") & "' Or 收入分类代码 Like '" & drr("收入分类代码") & "%'")
Filter = Filter & "收支分类 In ('" & str.Replace("|","','") & "')"
End If
If .Value IsNot Nothing Then 收入分类不为空才会执行
Filter = Filter & "记账日期>= #" & dt1 & "# And 记账日期 <= #" & dt2 & "#"
If Filter > "" Then
Filter = Filter & " And "
End If
End If
End With