根据实战演练学习设计菜单,三个全部存在问题,请指教
1、日期筛选按钮的代码好像不对
Dim t As Table = CurrentTable
If t.Current Is Nothing Then
Return
End If
Dim StartDate As Date
Dim EndDate As Date
With RibbonTabs("日常操作")("日期筛选")
StartDate = .Items("StartDate").Value
EndDate = .Items("EndDate").Value
End With
Dim filter As String
If StartDate IsNot Nothing Then
filter = "[日期] >= #" & StartDate & "#"
End If
If EndDate IsNot Nothing Then
If filter > "" Then
filter = filter & " and "
End If
filter = filter & " [日期] <= #" & EndDate & "#"
End If
CurrentTable.Filter = And "[日期] <= #" & EndDate & "#"
2、列名选择代码完全按照实战演练要求做成自己的,不能显示列名。
3、高级筛选使用以下代码显示无RibbonTabs("Common"),具体代码如下,请指教
Dim ng As New RibbonMenu.Group("高级筛选") '定义新的功能组
ng.Text = "高级筛选" '设置功能组标题
RibbonTabs("日常操作").Groups.Add(ng) '将功能组加入实战演练功能区
With RibbonTabs("Common").Groups("SortAndFilter")
ng.Items.Add(.Items("Filter")) '添加筛选按钮
ng.Items.Add(.Items("SelectFilter")) '添加选择按钮
ng.Items.Add(.Items("UnFilter")) '添加撤销按钮
ng.Items.Add(.Items("Separator")) '添加分隔条
ng.Items.Add(.Items("Toggle")) '添加切换按钮
End With