View Full Version : save problem


loki
05-22-2001, 11:27 AM
I have a form bound to a table. After I have saved a record I can go back and make changes without hitting the save button and the changes are carried over to the table. I want to be able to make changes to a record on my form but I don't want the changes to be commited until I hit save.

Pat Hartman
05-22-2001, 04:18 PM
You need to create a public variable that you set in the click event of the save button and check (and reset) in the BeforeUpdate event of the form. If the variable is not set when you enter the BeforeUpdate event, that means that the user did not click the save button. He got sent here automatically by Access because he attempted to leave the current record, either by closing the form, tabbing to the next record, or using the scroll buttons. If the variable is not set, you can display a message box and cancel the update.