How to undo whole record
This tip I learned from MVP Allen Browne
Here a code, which you can place into Undo button click event:
Here a code, which you can place into Undo button click event:
If Me.Dirty Then
Me.Undo
End If
If Not Me.NewRecord Then
RunCommand acCmdDeleteRecord
End If
8 Comments:
Very useful, thanks. I was strugling with undo on a form with both bound and unbound controls and couldn't get the "DoCmd" to work properly. But this code does the trick.
i was wondering if we can bypass the prompt for deletion
i mean, if there was no prompt before deleting the record, the undo operation would have looked more realistic :)
any thoughts?
This comment has been removed by the author.
Hi,
you can switch off delete prompts in access options
ya that works :)
tools > options > Edit/Find > Confirm (Uncheck Record Changes option)
thanks for your "prompt" reply :)
Or you could put in VBA:
DoCmd.SetWarnings (False)
...here comes your 'undo' code
DoCmd.SetWarnings (True)
_ _ _ _ _ _ _ _ _ _ _ _
this way you would have the warnings only temporarly inactive.
Amazing!
Anyone who knows where I can find a solution for this for Access 2010 Web (Macro style)?
Post a Comment
<< Home