以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  日期菜单  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=125000)

--  作者:q2520
--  发布时间:2018/9/18 10:03:00
--  日期菜单
Dim filter As String = "1=1"
Dim d1 As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1")
If d1.Value IsNot Nothing Then
filter = filter & " and 日期 >= #" & d1.Value &"#"
End If
d1 = e.Form.Controls("DateTimePicker2")
If d1.Value IsNot Nothing Then
filter = filter & " and 日期 <= #" & d1.Value &"#"
End If
Dim g As New GroupTableBuilder("统计表", DataTables("审批"))
g.Groups.AddDef("日期","月")
g.Groups.AddDef("起爆器材_类型")
g.Totals.AddDef("起爆器材_数量")
g.Totals.AddDef("炸药_数量")
g.Groups.AddDef("炸药_类型")
g.VerticalTotal = True
g.Filter = filter
g.Build()

MainTable = Tables("统计表")


With Tables("统计表")
    .Cols("月").Move(0)
    .Cols("炸药_类型").Move(1)
    .Cols("炸药_数量").Move(2)
End With

这个是蓝老师给帮忙写的  一个统计窗口的代码    我现在想把这个功能放在菜单里用   老师给帮忙弄一下    就是这个图的意思

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20180918100203.png
图片点击可在新窗口打开查看


--  作者:有点甜
--  发布时间:2018/9/18 10:24:00
--  

参考

 

http://www.foxtable.com/webhelp/scr/1137.htm

 


--  作者:q2520
--  发布时间:2018/9/18 10:27:00
--  
看了   不会改才求救的  我都是实在解决不了  才问的
--  作者:有点甜
--  发布时间:2018/9/18 10:57:00
--  

Dim filter As String = "1=1"
Dim d1 As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1")
If d1.Value IsNot Nothing Then
    filter = filter & " and 日期 >= #" & d1.Value &"#"
End If
d1 = e.Form.Controls("DateTimePicker2")
If d1.Value IsNot Nothing Then
    filter = filter & " and 日期 <= #" & d1.Value &"#"
End If

 

改成

 

Dim filter As String = "1=1"
Dim StartDate As Date
Dim EndDate As Date
With RibbonTabs("实战演练")("任务五")
    StartDate = .Items("StartDate").Value
    EndDate = .Items("EndDate").Value
End With

If startDate <> Nothing Then
    filter = filter & " and 日期 >= #" & startDate &"#"
End If
If EndDate <> Nothing Then
    filter = filter & " and 日期 <= #" & EndDate &"#"
End If