
此主题相关图片如下:111.png

各位大师下午好!!
如上图,在问题类型分项中的五列为逻辑列,想法是在分项中选为真时,“问题类型”列的值等于分项的列名。我的代码如下,但总觉得应该有简捷的方法,请大师指导,谢谢:
If e.DataCol.Name = "乱占" Then '如果是乱占列的内容变动
If e.NewValue = True Then '而且变动后的值是True(已勾选)
e.DataRow("问题类型") = "乱占" '那么当前行的问题类型为乱占
Else
e.DataRow("问题类型") = Nothing '否则为空值
End If
End If
If e.DataCol.Name = "乱采" Then
If e.NewValue = True Then
e.DataRow("问题类型") = "乱采"
Else
e.DataRow("问题类型") = Nothing
End If
End If
If e.DataCol.Name = "乱堆" Then
If e.NewValue = True Then
e.DataRow("问题类型") = "乱堆"
Else
e.DataRow("问题类型") = Nothing
End If
End If
If e.DataCol.Name = "乱建" Then
If e.NewValue = True Then
e.DataRow("问题类型") = "乱建"
Else
e.DataRow("问题类型") = Nothing
End If
End If
If e.DataCol.Name = "其他" Then
If e.NewValue = True Then
e.DataRow("问题类型") = "其他"
Else
e.DataRow("问题类型") = Nothing
End If
End If