If e.DataCol.Name = "住院号" Then Dim vals() As String = e.NewValue.split(":") If vals.length > 2 Then e.DataRow("住院号") =vals(2) Else e.DataRow("住院号") =vals(0) End If Dim dr As DataRow = DataTables("入院登记").Find("[住院号] = '" & e.NewValue & "'") If dr IsNot Nothing Then e.DataRow("患者姓名") = dr("患者姓名") Else MsgBox("项目不存在,请重新输入!",64,"提示") e.DataRow("患者姓名") = Nothing End If End If
|