改成下面,如果还报错,应该不是这段代码有问题。
systemready = False
Dim r As Row = e.Table.current
If r IsNot Nothing AndAlso Forms("工厂无损录入主界面").Opened Then
Dim sd As WinForm.CheckBox = Forms("工厂无损录入主界面").Controls("锁定_工厂")
If sd.Checked = True
Return ""
Else
Forms("工厂无损录入主界面").Controls("车间").Text = r("车间")
Forms("工厂无损录入主界面").Controls("班组").Text = r("班组")
End If
End If
If r IsNot Nothing AndAlso Forms("工厂无损录入主界面").Opened Then
Dim bz As WinForm.ComboBox = Forms("工厂无损录入主界面").Controls("班组")
If r("构件编号") = "下料" Then
bz.Value = "下料"
End If
End If
systemready = True