Case "设备清单"
Dim d1 As Date = Date.now
Dim d2 As String = Format(d1,
"yyyyMMddHHmmssfff")
Dim y As String = d2.substring(0, 4)
Dim m As String = d2.substring(4, 2)
If m = "12" Then
y = y + 1
m = 1
For r As Integer = 0 To
Tables("设备清单").rows.count - 1
Dim dr As Row = Tables("设备清单").Rows(r)
If dr("报废状态") =
"未报废" Then
dr("年份") = y
dr("月份") = m
Else
dr("年份") =
Nothing
dr("月份") =
Nothing
End If
Next
Else
y = y
m = m + 1
For r As Integer = 0 To
Tables("设备清单").rows.count - 1
Dim dr As Row = Tables("设备清单").Rows(r)
If dr("报废状态") =
"未报废" Then
dr("年份") = y
dr("月份") = m
Else
dr("年份") =
Nothing
dr("月份") =
Nothing
End If
Next
End If
'2024/4/1 这段有用的
If user.Name = "开发者" OrElse
User.Group = "模具" OrElse User.Group = "模具工程师" Then
DataTables("设备清单").DataCols("设备编号").RaiseDataColChanged()
End If
上面的代码是放在 maintablechanged 里面的,当切换数据表时,就一直在执行代码,好像死循环一样,以前都不会这样的。如果把红色那部分注释掉,就不会了。请问是什么原因呢?谢谢。