J
John S. Ford, MD
I have a subform embedded into a main form. It has some buttons on it that
allow the user to enter a new record and decide whether to save it or cancel
it (cmdNew, cmdSave, cmdCancel buttons). The problem is that the user can
unfortunately do a number of other things that will bypass the save and
cancel buttons:
1) Close the form.
2) Close the database.
3) Move to another record in the subform by the navigation buttons.
4) Probably other ways that I haven't discovered.
Any of these things will cause the new record to be saved probably without
the user realizing it thus allowing bad or incomplete data into the
database.
How can I implement the sort of Save, Delete or Cancel MsgBox seen on
Windows applications where before the application is closed, the MsgBox
arises allowing the user to save or delete prior to closing or actually
cancel the closing? I tried tying some code to the OnUnload event but this
doesn't seem to work (the application closes or the form closes
prematurely).
John
allow the user to enter a new record and decide whether to save it or cancel
it (cmdNew, cmdSave, cmdCancel buttons). The problem is that the user can
unfortunately do a number of other things that will bypass the save and
cancel buttons:
1) Close the form.
2) Close the database.
3) Move to another record in the subform by the navigation buttons.
4) Probably other ways that I haven't discovered.
Any of these things will cause the new record to be saved probably without
the user realizing it thus allowing bad or incomplete data into the
database.
How can I implement the sort of Save, Delete or Cancel MsgBox seen on
Windows applications where before the application is closed, the MsgBox
arises allowing the user to save or delete prior to closing or actually
cancel the closing? I tried tying some code to the OnUnload event but this
doesn't seem to work (the application closes or the form closes
prematurely).
John