Roger's Access Library Homepage
Forum Home Forum Home > Other Download Libraries > MS Access MVP Libraries > Tejpal, A.D.
  New Posts New Posts RSS Feed - Form_SubformSaveUndo.mdb
  FAQ FAQ  Forum Search   Events   Register Register  Login Login


Please consider donating $1 per sample downloaded, (find out why here)

Form_SubformSaveUndo.mdb

 Post Reply Post Reply
Author
Message
A.D. Tejpal View Drop Down
Microsoft MVP
Microsoft MVP


Joined: 30 Jun 2008
Status: Offline
Points: 192
Post Options Post Options   Thanks (0) Thanks(0)   Quote A.D. Tejpal Quote  Post ReplyReply Direct Link To This Post Topic: Form_SubformSaveUndo.mdb
    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.

Download Access 2K/XP/2K3: uploads/37/Form_SubformSaveUndo.zip

--

Email: adtejpal@gmail.com
Back to Top
Sponsored Links


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down