Foxtable(狐表)用户栏目专家坐堂 → [求助]窗口运行时,执行操作后,窗口自动关闭了,想问一下是哪里出现问题了?


  共有5516人关注过本帖树形打印复制链接

主题:[求助]窗口运行时,执行操作后,窗口自动关闭了,想问一下是哪里出现问题了?

帅哥哟,离线,有人找我吗?
小梧桐
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:16 积分:215 威望:0 精华:0 注册:2022/6/17 17:07:00
[求助]窗口运行时,执行操作后,窗口自动关闭了,想问一下是哪里出现问题了?  发帖心情 Post By:2023/1/3 12:50:00 [显示全部帖子]

您好,以下代码我写在表事件里面的click中。在窗口运行时,我点这个表,运行以下操作,窗口会自动关闭,想问一下是哪里出现问题呢


Dim str1 As String = Tables("原因关键词1").current("关键词1")
Dim str2 As String = Tables("原因关键词1").current("关键词2")
Dim filter As String
If str2 = "" Then
    filter = "原因 Like '%" & str1 & "%'"
Else
    filter = "原因 Like '%" & str1 & "%'" & " And " & "原因 Like '%" & str2 & "%'" 
End If

Tables("HAZOP").Filter = filter

Dim txt3 As WinForm.TextBox = e.Form.Controls("TextBox3")
txt3.text = Tables("HAZOP").Rows.Count

DataTables("后果ID统计").DataRows.Clear()


Dim b As New GroupTableBuilder("后果ID", DataTables("HAZOP"))
b.Groups.AddDef("后果主题ID") '根据后果主题ID分组
b.Totals.AddDef("后果主题ID", AggregateEnum.Count, "出现次数")
b.filter = Tables("HAZOP").filter
b.Build '生成统计表
MainTable = Tables("后果ID") '打开生成的统计表
Tables("后果ID").Save()

Dim Cols1() As String = {"后果主题ID", "出现次数"}
Dim Cols2() As String = {"后果主题ID", "出现次数"}
For Each r1 As Row In Tables("后果ID")
    Dim r2 As Row = Tables("后果ID统计").AddNew()
    For i As Integer = 0 To Cols1.Length - 1
        r2(Cols2(i)) = r1(Cols1(i))
    Next
Next

 回到顶部