Here is the code that I am using on a before update event:
Private Sub Media1_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Data has changed."
strMsg = strMsg & "@Do you wish to save the changes?"
strMsg = strMsg & "@Click Yes to Save or No to Discard changes."
If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes Then
'do nothing
Else
'DoCmd.RunCommand acCmdUndo
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
End If
End Sub
And this is what I get:
Getting runtime error 2046
The command or action 'Undo' is unavailable right now.
I am on Access 2000
[This message has been edited by GregSmith (edited 05-09-2002).]
Private Sub Media1_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Data has changed."
strMsg = strMsg & "@Do you wish to save the changes?"
strMsg = strMsg & "@Click Yes to Save or No to Discard changes."
If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes Then
'do nothing
Else
'DoCmd.RunCommand acCmdUndo
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
End If
End Sub
And this is what I get:
Getting runtime error 2046
The command or action 'Undo' is unavailable right now.
I am on Access 2000
[This message has been edited by GregSmith (edited 05-09-2002).]