关于ComboBOX的问题已经解决,也不知道为什么?
在控件的ValueChanged事件输入:
'If e.Sender.Value <> "" Then
'Dim bomid As String = e.Sender.Value
'Dim dr As DataRow = DataTables("产品结构清单主文件").Find("物料清单编码 = '" & bomid & "'")
'If dr IsNot Nothing Then
'With Tb
'.Current("描述") = dr("产品描述")
'.Current("单位") = dr("计量单位")
'.Current("原版本") = dr("版本")
'End With
'End If
'End If
在表事件DataColChanged输入则不会出现问题:
Select Case e.DataCol.Name
Case "物料清单编码"
If e.DataRow.IsNull("物料清单编码") Then
MessageBox.Show("请输入物料清单编码!","提示")
e.Cancel = True
Else
Dim dr As DataRow = DataTables("产品结构清单主文件").Find("物料清单编码 = '" & e.DataRow("物料清单编码") & "'")
If dr IsNot Nothing Then
e.DataRow("描述") = dr("产品描述")
e.DataRow("单位") = dr("计量单位")
e.DataRow("原版本") = dr("版本")
End If
End If
End Select