以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 单元格按钮打开窗口时报错 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=140231) |
-- 作者:deliangzhaoe -- 发布时间:2019/9/1 17:17:00 -- 单元格按钮打开窗口时报错 单元格按钮打开窗口时报错: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 索引超出范围。必须为非负且小于集合的大小。 参数名称:索引 afterload代码为: \'隐藏模式窗口和独立窗口的关闭按钮,保留最大化和最小化按钮 \'e.Form.DisableXButton() Dim r1 As Row = vars("设备设施清单").current Dim t1 As Table = e.Form.controls("Table1").Table Dim filter1 As String = "1=1" If r1("设备名称") > "" Then filter1 &= " and 风险点_名称 = \'" & r1("设备名称") & "\' and [风险点_类型] = \'设备设施\' and 企业名称 = \'" & r1("企业名称") & "\'" End If t1.filter = filter1 \'所有当前表定位在最末行 Tables("设备设施风险分级情况查看_table1").sort = "作业步骤或检查项目_序号" For Each c As object In e.form.controls If typeof c Is winform.Table Then Dim a As Table = c.Table a.position = a.rows.count-1 End If Next \'风险点所在部门或岗位下拉窗口 Tables("设备设施风险分级情况查看_table1").Cols("风险点_所在车间或岗位").DropForm = "风险点所在车间或岗位下拉" Tables("双体系清单").Cols("风险点_所在车间或岗位").DropForm = "风险点所在车间或岗位下拉" Tables("设备设施风险分级情况查看_table1").Cols("LS评价_可能性").DropForm = "LS法L下拉" Tables("双体系清单").Cols("LS评价_可能性").DropForm = "LS法L下拉" Tables("设备设施风险分级情况查看_table1").Cols("LS评价_严重性").DropForm = "LS法S下拉" Tables("双体系清单").Cols("LS评价_严重性").DropForm = "LS法S下拉" Tables("设备设施风险分级情况查看_table1").Cols("MES_控制措施").DropForm = "MES法M下拉" Tables("双体系清单").Cols("MES_控制措施").DropForm = "MES法M下拉" Tables("设备设施风险分级情况查看_table1").Cols("MES_频繁程度").DropForm = "MES法E下拉" Tables("双体系清单").Cols("MES_频繁程度").DropForm = "MES法E下拉" Tables("设备设施风险分级情况查看_table1").Cols("MES_后果").DropForm = "MES法S下拉" Tables("双体系清单").Cols("MES_后果").DropForm = "MES法S下拉" 设备设施风险分级情况查看_table1新增一行时出现混乱,序号列不再加1,新增的行不再复制最后一行的部分列内容,新增的行位置也不在最后一行。 [此贴子已经被作者于2019/9/1 17:26:09编辑过]
|
-- 作者:有点蓝 -- 发布时间:2019/9/1 21:00:00 -- 调试技巧:http://www.foxtable.com/webhelp/topics/1485.htm 看看哪一句代码有问题?
|