我在表“客观题答案”的DataColChanged事件中写入如下代码。想要实现在表“客观题答案”的“试卷号”列输入相关内容,其他三个表的“试卷号”列也随之写入与表“客观题答案”的“试卷号”列相同内容。如果在表“客观题答案”中插入一空行并输入内容,其他三个表也要产生相应的操作。但是插入表并输入内容后出现如下图片,同时不能实现插入操作,请问如何修改代码。
代码:
If e.DataRow("试卷号") IsNot Nothing Then
Dim sjhdr1 = DataTables("错误学生与人数统计").find("[_Identify] = '" & e.DataRow("_Identify") & "'")
Dim sjhdr3 = DataTables("考点频度统计").find("[_Identify] = '" & e.DataRow("_Identify") & "'")
Dim sjhdr2 = DataTables("考点描述").find("[_Identify] = '" & e.DataRow("_Identify") & "'")
sjhdr1("试卷号") = e.DataRow("试卷号")
sjhdr2("试卷号") = e.DataRow("试卷号")
sjhdr3("试卷号") = e.DataRow("试卷号")
If sjhdr1 Is Nothing And sjhdr2 Is Nothing And sjhdr3 Is Nothing Then
sjhdr1 = DataTables("错误学生与人数统计").AddNew
sjhdr2 = DataTables("考点频度统计").AddNew
sjhdr3 = DataTables("考点描述").AddNew
End If
End If
提示信息如下:
此主题相关图片如下:捕获.png