View Full Version : Me.Undo vs. DoCmd.RunCommand acCmdUndo


Dudley
05-22-2007, 02:49 PM
I'm wondering about the relative merits of Me.Undo versus DoCmd.RunCommand acCmdUndo. Why would I use one or the other, and when? Is one better than the other?

Generally, I'm using one or the other on forms in BeforeUpdate as part of error-trapping and saving records.

I'm afraid the depth of my knowledge is that I notice that Me.Undo is shorter. ;)

Any help with deepening my understanding? Or pointers to references equally appreciated. Many thanks!

gemma-the-husky
05-22-2007, 03:31 PM
dont know which - but i think one of the commands will be old-style, but retained to maintain compatibility with previous versions of access, so both do the same

eg sendkeys is still supported, but there are easier ways of doing things

eg there are some things that can be done by docmd object, or runcommand method, (i think in those cases access recommend runcommand)

im sure there are many others as well

unclejoe
05-22-2007, 06:34 PM
Hi Dudley,

The "Me." refers to the current object that is in focus. i.e. the the form is open and is running.

However, "Me." cannot work with a form that is not in focus. So what if the second form that is not in focus? That's where "Docmd.RunComand acCmdUndo" come in.

I'm wondering about the relative merits of Me.Undo versus DoCmd.RunCommand acCmdUndo. Why would I use one or the other, and when? Is one better than the other?

Generally, I'm using one or the other on forms in BeforeUpdate as part of error-trapping and saving records.

I'm afraid the depth of my knowledge is that I notice that Me.Undo is shorter. ;)

Any help with deepening my understanding? Or pointers to references equally appreciated. Many thanks!

Dudley
05-22-2007, 09:38 PM
Thanks folks!

jkl0
05-23-2007, 05:10 AM
This link has some more info.

http://www.pcreview.co.uk/forums/thread-1162440.php

Dudley
05-23-2007, 06:29 AM
That's it! Thanks!!!