I have a question for which I have search net for last 3 hours but could not find answer.
I have an entry form over which I have placed an 'undo' button with following code
Expand|Select|Wrap|Line Numbers
- Private sub cmdUndo_OnClcik()
- If Form.Dirty Then
- DoCmd.RunCommand acCmdUndo
- Else: Exit Sub
- End If
- End sub
Now I come to the question that I find answer of;
When Its new record and I press Undo button after some entering data in some textbox controls, it deletes all record, because when I enter data again, Primary ID gets changed.
what I guess that its is because undo deletes all entries that has not been saved.
With this all in background, is there any way that undo deletes or erases data only from that control, in which it was entered just before pressing undo. And if its not possible, then is it possible that undo does not delete the record altogether and preserves primary ID?
Please help me find the answers
Thanks