human_anomaly
Registered User.
- Local time
- Today, 01:03
- Joined
- Apr 12, 2004
- Messages
- 69
I an adp database that is connected to an sql server. I have a form that lets the user edit records. I want the user to be given the option to save their changes when closing the form. My code does something like this:
form_beforeUpdate method ()
check for changes
ask user if they would like to save changes
if yes then check for missing data
if there is missing data ask the user if they would like to save with the missing data or add the missing data to the form
if the user wants to add the data then cancel = true and exit sub
else save the data
Now I this method also runs when the user switches between records and it works fine; however when this method runs when the form is being closed I have a problem. The problem is that if the user has some missing data and they want to go back and add the data instead of closing the form and saving it does let them go back and add the missing data, but it also discards all the changes that they have mades so far (which is the problem). This seems to occur as soon as the Form_Unload event occurs. Is their any way, while in the beforeUpdate event, of telling the unload event to not run? Or does anyone know why the changes are being discarded? If there is anything I can clear up let me know. Thanks in advance.
form_beforeUpdate method ()
check for changes
ask user if they would like to save changes
if yes then check for missing data
if there is missing data ask the user if they would like to save with the missing data or add the missing data to the form
if the user wants to add the data then cancel = true and exit sub
else save the data
Now I this method also runs when the user switches between records and it works fine; however when this method runs when the form is being closed I have a problem. The problem is that if the user has some missing data and they want to go back and add the data instead of closing the form and saving it does let them go back and add the missing data, but it also discards all the changes that they have mades so far (which is the problem). This seems to occur as soon as the Form_Unload event occurs. Is their any way, while in the beforeUpdate event, of telling the unload event to not run? Or does anyone know why the changes are being discarded? If there is anything I can clear up let me know. Thanks in advance.