MsgBox
如果用户在提示下选择“否”,我正在尝试恢复到原始值。然而,这并没有发生。你能看看我哪里出错了吗?
Private Sub txtNov2_AfterUpdate()
Dim x As Integer
Dim NewValue As Integer
Dim OrigValue As Integer
NewValue = Me.txtNov2.Value
OrigValue = [Forms]![DataEntry]![txtNov2].OldValue 'Me.txtNov2.OldValue
If NewValue <> OrigValue Then
x = MsgBox("Value Has Changed Do you Want to Update?", vbQuestion + vbYesNo, "Value Change")
If x = vbYes Then
MsgBox ("Please Press Update Button")
btnUpdateData2.SetFocus
Else
txtNov2.SetFocus
'Me.Undo
txtNov2.Value = OrigValue
'Cancel = True
End If
End If
End Sub