以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]代码中的具体窗口改为当前窗口,哪里错了? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=89341) |
-- 作者:jyh7081 -- 发布时间:2016/8/19 12:30:00 -- [求助]代码中的具体窗口改为当前窗口,哪里错了? 原代码是在表A中设置的代码,现在想在功能区设置一个共用的按钮,对当前表起作用,我把下划线的两行代码改成了下面的三行斜体字,但没运行,请老师帮忙看看: Dim clbx1 As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1") Dim clbx2 As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox2") For Each j As Integer In clbx2.CheckedIndices Dim tm As String = ProjectPath & "模板文件\\" & clbx2.Items(j) \'指定模板文件 For Each i As Integer In clbx1.CheckedIndices Dim fl As String = ProjectPath & "成品文件\\" & clbx1.items(i)("案号") & clbx2.Items(j) \'指定目标文件 Dim wrt As New WordReport(Tables("表A"),tm,fl) \'定义一个WordReport Dim dr As DataRow = DataTables("表A").Find("_Identify = \'" & clbx1.items(i)("_Identify") & "\'") If dr IsNot Nothing \'Dim nm As String = CurrentTable.Name \'Dim wrt As New WordReport(Tables("nm"),tm,fl) \'定义一个WordReport \'Dim dr As DataRow =DataTables("nm").Find("_Identify = \'" & clbx1.items(i)("_Identify") & "\'") wrt.BuildOne(dr) wrt.quit Dim proc As new Process proc.File = fl proc.Start End If Next Next |
-- 作者:czy -- 发布时间:2016/8/19 13:04:00 -- Tables("nm") 改成 Tables(nm) |
-- 作者:jyh7081 -- 发布时间:2016/8/19 13:26:00 -- 试试,谢谢超版! |