Rollback changes in subform when subform lost focus

J

Jen S

I am building a Amend Screen such that Client can change/edit data when they
receive new information after the Order record is created.

I am using a Edit button to allow changes to the record. If user plans to
save the changes, they must use the save button to update the changes.

I am using a subform (recordsource = query) to display the details of the
particular Order. User can use the subform to edit the data. If they plan to
save, they can use the Save button.

My problem is when user do not want to save, and they change the combo box
to view another Order record, the dirty subform would already save the data.
How can I prevent the original data from been change when user do not click
on Save button.

Also, I have a 'close form' button which also exhibits similar behavior. If
user edits the subform, do not save the data using the Save button, and click
on the 'close form' button, the subform data will also be saved. How can I
prevent this from happening?

I read of a possible solution that is to create a temp table and store the
original data to it. Whenever the subform is dirty, copy the original data
back. However, this soln does not work if referential integrity is enforce.

My design is using referential integrity for the relationships. What can I
do to overcome this?
 

Kan

Joined
Sep 2, 2009
Messages
6
Reaction score
0
i have a similar problem. the user enters a certain amount of data , and if he clicks on the subform and the main form loses focus the data gets saved. I don't want this to occure because on the save button i have a stop time field witch populates the table with the now () function.

Did you manage to fix the problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top