代码是这样的,当“竣工日期”为空是按保存,提示上面的错误。
With Tables("电梯信息表")
Dim drx1 As Row=Tables("电梯信息表").Current
If drx1.isnull("竣工日期") Then
messagebox.show("必须输入竣工日期")
Forms("电梯信息表").Controls("DateTimePicker1").Select()
Return
End If
If drx1.isnull("合同编号") Then
messagebox.show("必须输入合同编号")
Forms("电梯信息表").Controls("TextBox42").Select()
Return
End If
。。。。。
If .Current.DataRow.RowState = DataRowState.Unchanged Then '如果当前行未曾修改
MessageBox.Show("该记录未被修改,不需要进行保存操作")
Else
Tables("电梯信息表").Current.Save()
Tables("电梯信息表").Current.Locked = True
MessageBox.Show("当前行已经被保存,若想撤销,请<撤销修改>! ")
End If
End With