改一下
With Tables("档案管理总表")
If .Current IsNot Nothing Then
.Current.Save()
End If
End With
Dim r As Row = Tables("档案管理总表.档案管理明细").Current
With Tables("档案管理总表.档案管理明细")
If r("档案编号") = Nothing OrElse r("档案名称") = Nothing OrElse r("档案类型") = Nothing OrElse r("归档日期") = Nothing OrElse r("保管期限") = Nothing OrElse r("档案明细名称") = Nothing OrElse r("部门1") = Nothing OrElse r("部门2") = Nothing OrElse r("办事处") = Nothing OrElse r("档案移交人") = Nothing OrElse r("档案室") = Nothing OrElse r("档案柜") = Nothing OrElse r("档案明细名称") = Nothing OrElse r("档案明细日期") = Nothing OrElse r("档案明细编号") = Nothing
Messagebox.show("档案明细录入不全,请录入!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
For i As Integer = 0 To .Rows.count - 1
.Rows(i).Locked = True
.Rows(i).Save
Next
Messagebox.show("档案明细已保存!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
DataTables("档案管理总表").AllowEdit = False
DataTables("档案管理明细").AllowEdit = False
End If
End If
End With
[此贴子已经被作者于2014-5-8 10:57:48编辑过]