Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Undo in main form and subform

Status
Not open for further replies.

edgarchado

Technical User
Apr 5, 2005
59
AR
Hi all,

I have a main form and a subform within it. I have an undo changes button in the main form. When I press this button it reverts any changes made to the main form but not to the sub form. Is there a way to rever changes in both forms when I press this button?

Thanks in advance
 
Not without a great deal of work.
In principle you have to create a table of 'before' records so that if the user wants to undo them you can update the current records with the Before images.

This means that you have to create a table to hold the 'Before' images. As you move to each main form record you clear the table of anything that you stored earlier and copy the subform records to that table ( so that they can be used as above to backdate the records if the user wants to undo.)
 
lupins,

I think I didn't make myself very clear. I have in my project two main forms: orders and modify orders. the undo button is in the modify orders form.

My users generate an order with the orders form and may modify orders with the second form.

What I need is to undo any changes added to the order through the second form before updates the date in the table.

 

When you from a main form to a subform, the main form record is saved.
When you move from a subform record to a different subform record or the main form, the subform record is saved.

If your subform only contains one record then you can put undo buttons on the main form and the subform and you will probably get away with it most of the time.
But, for example, if the user mods a field on the main form, then a field on the subform and then goes back to change another field on the main form you have no means of getting the main form back to its initial state.

If you have two or more subform records then an undo button will only work on the last record to be changed. So if the user changes two or more subform records you cannot get back to the initial state.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top