修改了一下好像不会提示错误了
Dim pm As string = Tables("表A").Current("品名")
Dim pmb As DataRow = DataTables("表B").Find("[品名] = '" & pm & "'")
if Tables("表A").Current("品名") = nothing then
Tables("表A").Current("编号") = nothing '这下面几行能简化一下吗?如果整行清空怎么写?
Tables("表A").Current("数量") = nothing
Tables("表A").Current("启用日期") = nothing
Tables("表A").Current("部门") = nothing
else
Tables("表A").Current("编号") = pmb("编号")
If Tables("表A").Current("部门") is nothing andalso pmb("部门") = -1 Then
Messagebox.Show("请选择部门!", "提示",MessageBoxButtons.OK)
Dim bm As string = Tables("表A").Current("部门")
If bm Is Nothing Then
e.Table.Select(e.Table.RowSel, e.Table.Cols("部门").Index -1)
End If
End If
End If
[此贴子已经被作者于2009-2-18 19:33:44编辑过]