Currently I have code in the form's BeforeUpdate event to notify the user if the record is dirty, telling them that they must save the record before proceeding. The event is then cancelled and everything works fine.
The problem I need help with is that when the user tries to close a dirty form using the close button (X) in the top right hand corner of the form, after my notification message, MS-Access displays the message:
You can't save this record at this time.
Ms-Access may have necountered an error while trying to save a record.
If you close this object now, the data changes you made will be lost.
Do you want to close the database object anyway?
I have tried putting code in the the form's UnLoad event (as I have seen suggested in a million posts) but the message comes before the event occurs. I have too many forms to remove the close button (X) and manually add my own button control. Any thoughts on how I can handle this would be appreciated.
The problem I need help with is that when the user tries to close a dirty form using the close button (X) in the top right hand corner of the form, after my notification message, MS-Access displays the message:
You can't save this record at this time.
Ms-Access may have necountered an error while trying to save a record.
If you close this object now, the data changes you made will be lost.
Do you want to close the database object anyway?
I have tried putting code in the the form's UnLoad event (as I have seen suggested in a million posts) but the message comes before the event occurs. I have too many forms to remove the close button (X) and manually add my own button control. Any thoughts on how I can handle this would be appreciated.