Dim Flt As String
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
If Flt >"" Then
Flt = Flt & " And "
End If
Flt = Flt & "[签约日期] >= #" & .Value & "#"
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
If Flt >"" Then
Flt = Flt & " And "
End If
Flt = Flt & "[签约日期] <= #" & .Value & "#"
End If
End With
With e.Form.Controls("TextBox1")
If .Value IsNot Nothing Then
If Flt >"" Then
Flt = Flt & " And "
End If
Flt = Flt & "[合同or费用名称] Like '" & .Text & "' Or [合同or费用对象简称] Like '" & .Text & "'"
msgbox(Flt)
End If
End With
'分组统计
Dim g As New GroupTableBuilder("项目合同费用查询", DataTables("合同or费用台账"))
g.Caption = "项目合同费用查询"
g.Groups.AddDef("项目代码", "项目")
g.Groups.AddDef("子项目代码", "子项目")
g.Groups.AddDef("签约日期", DateGroupEnum.Year, "年")
g.Groups.AddDef("费用分期")
g.Groups.AddDef("签约日期", DateGroupEnum.None)
g.Groups.AddDef("合同or费用对象简称", "合同or费用对象")
g.Groups.AddDef("四级费用类别", "合同or费用内容")
g.Totals.AddDef("合同or费用编号", AggregateEnum.Count, "合同or费用数量")
g.Totals.AddDef("合同or费用总额", "合同or费用金额")
g.GrandProportion = True
g.Decimals = 2
g.Filter = Flt
g.Build()
MainTable = Tables("项目合同费用查询")