News, links, downloads, tips and tricks on Microsoft Access and related
If Me.Dirty Then Me.Undo End If If Not Me.NewRecord Then RunCommand acCmdDeleteRecord End If
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 deletioni 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' codeDoCmd.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)?
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.
ReplyDeletei was wondering if we can bypass the prompt for deletion
ReplyDeletei 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.
ReplyDeleteHi,
ReplyDeleteyou can switch off delete prompts in access options
ya that works :)
ReplyDeletetools > options > Edit/Find > Confirm (Uncheck Record Changes option)
thanks for your "prompt" reply :)
Or you could put in VBA:
ReplyDeleteDoCmd.SetWarnings (False)
...here comes your 'undo' code
DoCmd.SetWarnings (True)
_ _ _ _ _ _ _ _ _ _ _ _
this way you would have the warnings only temporarly inactive.
Amazing!
ReplyDeleteAnyone who knows where I can find a solution for this for Access 2010 Web (Macro style)?
ReplyDelete