No Undo after `cut` statements

Undo appears to be disabled after any of the cut, cutcell and cutrecord statements. Is this intentional?


I can’t confirm this. Does your procedure contain a StartDatabaseChange statement?

I’m wondering if Michael is trying to undo something that was initiated via a procedure. If, for example, he used a cut statement in a procedure and then tried to undo it in the datasheet afterwords it will not work. If, however, he used this manually in the datasheet it would restore the cell.

My first assumption was that he was trying to undo what was in the procedure. I wrote a procedure like this

StartDatabaseChange "ALLRECORDS", "Delete Record" CutRecord

After running the procedure, I went to the Edit menu, and chose “Undo Delete Record” from the menu, and the record was restored.

I then tried running a procedure with a Cut command in it, but no StartDatabaseChange command. Before running the procedure I would edit a cell in the data sheet. After running the procedure, I could still undo the edit.

No matter how I interpreted it, I could not confirm that Undo was “disabled.”

My test was simply having a procedure with cut as the code and no StartDatabaseChange. In the datasheet I ran the procedure and it cut the active cell. Then using command-Z or using “Undo Edit Data Cell” (the only option shown at the top of the menu) from the Edit menu did not restore the data.

If you want Undo to work after a procedure, you must add a StartDatabaseChange statement to the procedure. There is a short video (free) that explains the reason for this, and how you do it. Also, there is an explanation in the Help file:

That’s almost exactly what I did - except I ran the procedure from the procedure using the Run icon. And, as Dave and Jim have explained, the StartDatabaseChange statement is the key.