Dim tb As Table = Forms("共有日志窗口").Controls("Table1").Table
tb.StopRedraw
If tb.Rows.Count > 0 Then
tb.DataTable.DeleteFor(True)
End If
Dim lbl数据表名 As WinForm.Label = Forms("共有日志窗口").Controls("lbl数据表名")
Dim lbl主键 As WinForm.Label = Forms("共有日志窗口").Controls("lbl主键")
lbl数据表名.text = CurrentTable.Name
lbl主键.text = CurrentTable.Current("_Identify")
If CurrentTable.Current IsNot Nothing AndAlso CurrentTable.Cols.Contains("日志") = True Then
If CurrentTable.Current.IsNull("日志") = False AndAlso CurrentTable.Current("日志") <> "" Then
Dim jihe As new List( of String)
jihe.AddRange(CurrentTable.Current("日志").Split(vblf))
If jihe.Count > 0 Then
For Each jh As String In jihe
Dim jihe1 As new List( of String)
jihe1.AddRange(jh.Split("|"))
If jihe1.Count = 7 Then
tb.AddNew()
tb.Current("字段") = jihe1(1).SubString(jihe1(1).IndexOf("=")+1,jihe1(1).Length-jihe1(1).IndexOf("=")-1)
tb.Current("原值") = jihe1(2).SubString(jihe1(2).IndexOf("=")+1,jihe1(2).Length-jihe1(2).IndexOf("=")-1)
tb.Current("新值") = jihe1(3).SubString(jihe1(3).IndexOf("=")+1,jihe1(3).Length-jihe1(3).IndexOf("=")-1)
tb.Current("修改日期") = Cdate(jihe1(4).SubString(jihe1(4).IndexOf("=")+1,jihe1(4).Length-jihe1(4).IndexOf("=")-1))
tb.Current("修改人") = jihe1(5).SubString(jihe1(5).IndexOf("=")+1,jihe1(5).Length-jihe1(5).IndexOf("=")-1)
tb.Current("修改终端") = jihe1(6).SubString(jihe1(6).IndexOf("=")+1,jihe1(6).Length-jihe1(6).IndexOf("=")-1)
End If
Next
End If
End If
Else
lbl主键.text = "无日志字段"
End If
tb.ResumeRedraw
问题出在红色代码处,但在表事件 CurrentChanged中完全正常