以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 菜单代码出现错误提示 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=188044) |
-- 作者:HANZHIGANG -- 发布时间:2023/8/29 9:17:00 -- 菜单代码出现错误提示 菜单Selecttab事件代码如下: If DataTables.Contains(RibbonTabs.SelectedTab.Name) = False Then \'如果表C没有加载 DataTables.Load(RibbonTabs.SelectedTab.Name) \'加载表C End If MainTable = Tables(RibbonTabs.SelectedTab.Name) Dim itm As Object For Each itm In RibbonTabs(RibbonTabs.SelectedTab.Name).Groups(RibbonTabs.SelectedTab.name).Items With RibbonTabs(RibbonTabs.SelectedTab.Name).Groups(RibbonTabs.SelectedTab.Name).Items(itm.name) If RibbonTabs.SelectedTab.Name <> "主界面" OrElse RibbonTabs.SelectedTab.Name <> "月末报表" Then If TypeOf itm Is RibbonMenu.ComboBox Then If DataTables(RibbonTabs.SelectedTab.Name).DataCols(itm.name).IsBoolean = False Then .Items.Clear For Each c As String In DataTables(RibbonTabs.SelectedTab.Name).SQLGetValues(itm.name, "", itm.name) Dim b As New RibbonMenu.Button(c) b.Text = c .Items.Add(b) Next End If End If End If End With Next 前期没问题 ,今天忽然出现错误提示: .NET Framework 版本:4.0.30319.42000 Foxtable 版本:2022.8.18.1 错误所在事件:菜单,SelectTab 详细错误信息: 未设置对象变量或 With 块变量。 没分析出是什么原因导致,请老师指导 |
-- 作者:有点蓝 -- 发布时间:2023/8/29 9:37:00 -- 调试 Dim itm As Object msgbox(RibbonTabs.SelectedTab.Name) msgbox(RibbonTabs(RibbonTabs.SelectedTab.Name).Groups(RibbonTabs.SelectedTab.name).Items.count) For Each itm In RibbonTabs(RibbonTabs.SelectedTab.Name).Groups(RibbonTabs.SelectedTab.name).Items msgbox(itm.name) With itm If RibbonTabs.SelectedTab.Name <> "主界面" OrElse RibbonTabs.SelectedTab.Name <> "月末报表" Then If TypeOf itm Is RibbonMenu.ComboBox Then If DataTables(RibbonTabs.SelectedTab.Name).DataCols(itm.name).IsBoolean = False Then .Items.Clear For Each c As String In DataTables(RibbonTabs.SelectedTab.Name).SQLGetValues(itm.name, "", itm.name) Dim b As New RibbonMenu.Button(c) b.Text = c .Items.Add(b) Next End If End If End If End With Next |