Form_SubformSaveUndo.mdb |
Post Reply |
Author | |
A.D. Tejpal
Microsoft MVP Joined: 30 Jun 2008 Status: Offline Points: 192 |
Post Options
Thanks(0)
Posted: 08 Jul 2008 at 11:03pm |
This sample db demonstrates user control over Save / Undo actions on a subform. There are two command buttons (CmdSave and CmdUndo) on the subform. It is convenient to place these buttons on the subform itself, as the subform gets updated as soon as the focus shifts to the main form. These command buttons are in disabled state to start with. As soon as the record gets edited and the form becomes dirty, both the buttons become enabled and the user can take appropriate action (Save or Undo). As long as the record remains dirty, a warning label remains displayed at top. If the user tries either to move to a different record or to exit the subform while the record is still dirty, the action is trapped via form's BeforeUpdate event, for prompting the user either to save or reject the changes. If, however, the change is saved / rejected through direct click on the Save / Undo buttons, the prompt is suppressed and the desired action gets carried out straightaway. Note - This solution is equally applicable to an independent form.
|
|
Sponsored Links | Want a good read? Try The Summer of His Life (available on Amazon!) |
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |