我做了个小项目
建了个表
此主题相关图片如下:1.jpg
假别弄了个下拉
此主题相关图片如下:2.jpg
又弄了个窗口
此主题相关图片如下:3.jpg
缺勤统计按钮的代码是
Dim g As New CrossTableBuilder("缺勤统计表", DataTables("员工缺勤统计表"))
Dim Filter As String
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("DateTimePicker1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "请假日期 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("DateTimePicker2")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "请假日期<= #" & .Value & "#"
End If
End With
g.Filter = Filter
g.HGroups.AddDef("姓名")
g.VGroups.AddDef("假别")
g.Totals.AddDef("请假时间", "请假时间")
g.Build()
MainTable = Tables("缺勤统计表")
我这个功能就是能对“姓名”“隶属类别”“假别”“起止时间”,进行筛选后统计 员工假别的总时间
现在我想在窗口上实现的功能是 多值 假别 筛选 后统计 员工假别的总时间
例如 我做的那个只能对 单一“假别” 或 所有“假别” 进行统计 现在想实现的就是 可以在窗口对 “病假” 和“计生” 的统计 就是可以对任意组合的“假别”统计
求代码!!!
先谢谢!
前几次图看不到!!!
[此贴子已经被作者于2012-2-12 11:10:40编辑过]