
Originally Posted by
data808
Ok so I have something to report. It appears that there is a difference between these commands:
DoCmd.Runcommand acCmdUndo and Me.Undo
The runcommand seems to undo one action at a time whereas the Me.Undo will undo the whole form.
This has been consistent to a certain degree and what I mean by that is, earlier this morning when I got to work, just for the hell of it, I decided to just run it as is with the DoCmd.Runcommand acCmdUndo again to see if I got the same result as I did at the beginning of this post. To my surprise it gave me the result I wanted! It undid the entire record even though I made many changes in creating the new record. I don't know why it happened because I did not change the code at all. So at this point I am confused but I go with it because as long as it's working, I'm not complaining. So I have another form that is similar and would like for this to work the same way so I go ahead and run this form just to see if it will work and it does. I check the code and on this second form it is using the Me.Undo command. So just to experiment I change it to the runcommand version and run it. It stops working. It only undoes one action of the form. But yet this is the exact same code that is working on form 1. I then close the database and reopen it. I try form 1 again just to make sure it's still working and now it has stopped working with the runcommand version of the undo command. So then I change it to the Me.Undo version and then it begins to work. So now I go back to form 2 and change it as well and it too is now working the way I wanted it to.
So it seems that Me.Undo is what I wanted but for some reason I did get the DoCmd.Runcommand acCmdUndo to work as well but only temporarily. Does anyone know what the hell is up with this? It's totally crazy. I just hope that the Me.Undo doesn't stop working one day because based on my experience here, this seems like a totally possible scenario.