Tuesday, March 17, 2009

New Sample: Form_UnBound_UnDoReDo

Form_UnBound_UnDoReDo

by A.D. Tejpal

Sample Db - Explanatory Notes

General:
This sample db demonstrates Undo / Redo features while entering / editing data through an unbound form. Use of collections for storing control and field values respectively, facilitates the process.

Adding a new record:
Clicking the Add command button presents a simulated new record in distinct back color (indicative of new record). As soon as it is made dirty, Save and Undo command buttons become enabled. Clicking Save adds the record to source table and back color changes confirming the process. If, instead of Save, Undo is clicked, the existing entries get ignored, and fresh blank new record is presented.

Editing an existing record:
Based upon selection in combo box, the controls get populated with the contents of desired record, with a back color distinct from that for new record. As soon as the record is made dirty (by making change in any of the controls), Save and Undo buttons get enabled.
Clicking the Undo button restores the original values and simultaneously, Redo button gets enabled (accompanied by disabling of Undo button). Clicking the Redo button restores the values back to recently edited ones. Simultaneously, Undo button gets enabled (accompanied by disabling of Redo button). The user can shuttle between the Undo & Redo buttons as often as desired. Different back colors confirm Undo / Redo actions.

Clicking Save button saves the record as edited.

Deleting records:
Clicking the Delete button deletes the selected record. At the same time, autonumber for source table gets reset suitably so that next one will get generated in sequence, without leaving any holes.

Version: Access 2000 File Format

You can find the sample here: http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=446

.

No comments: