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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BeginTrans Method For Record add/update in Form

Status
Not open for further replies.

Jables

Programmer
Aug 28, 2001
148
US
Does anyone out there know of a good way to use the BeginTrans / CommitTrans / Rollback methods in order to take input from a form and not make it permanent until the user closes the form?

I want to:
1. Open a form and find specific records to display. This part is not really a problem.
2. Allow the user to make changes to the records.
3. When the form is closed ask the user if they want to keep or discard the changes.

Maybe I'm barking up the wrong tree with the Transaction methods. I'm open to other suggestions.

Thanks
Clay Simmons
 
You could move your record update code to the OnClose event of the form. Ask the user if they wish to save the changes and if so write the changes to the database otherwise just close the form.

Kunjal
 
I don't think that will work.

here's why.

Form B is opened from a button on Form A. If there are already records associated with the data in Form A, then they will open and display in Form B. If not, then form B will open and allow the user to add a record.

So say that there are records in Form B that are associated with records in Form A, then when form B opens, the user will start modifying them, and right there, they've changed the record. When they hit close, they need to be given the option of rolling the record back to it's original state. If I start the record update code on the OnClose event, then it's already too late for a rollback.

Is it possible to clone the recordset when the form opens and then make changes to the cloned recordset and then set the cloned recordset as the form's recordset? I don't know, I've pretty much thought myself into a black hole on this one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top