编辑录入窗口中的“撤销修改”按钮,能否写成,对窗口中显示的这三个表同时进行判断?代码只写了一段,是控制第一个表的控件的“撤销修改”功能:
With Tables("入库订单表")
If .Current IsNot Nothing Then
If MessageBox.Show("确定要 撤销修改 吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
.Current.Reject()
End If
End If
End With
那么,下两个表,是不是可以写成是:
With Tables("入库明细表")
If .Current IsNot Nothing Then
If MessageBox.Show("确定要 撤销修改 吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
.Current.Reject()
End If
End If
End With
With Tables("出库明细表")
If .Current IsNot Nothing Then
If MessageBox.Show("确定要 撤销修改 吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
.Current.Reject()
End If
End If
End With
这下面两段代码的运行,是失败的,求指导,谢谢!
[此贴子已经被作者于2019/4/30 9:55:05编辑过]