Hi, Matthew.
This is a pain to me because many times
I don't want to save changes, but it automatically does save without
asking me.
Somewhere in your VBA code or in a macro you've turned the warnings off, but
didn't turn them back on again. This most commonly occurs when an error is
encountered, and your error handler fails to turn the warnings back on.
Search for the following line of VBA code:
DoCmd.SetWarnings False
.. . . where there isn't the following line of code to execute after it:
DoCmd.SetWarnings True
.. . . both in the procedure _and_ in the procedure's error handler. If you
can't find it in VBA code, then you'll have to search through each macro.
The best policy is to never turn the warnings off. Note that there are
alternative methods of VBA coding that never require the warnings to be
turned off. And they execute faster, too.
However, if the warnings are turned off in a macro, when the macro
encounters an error, there's no way to catch the error in an error handler
and the warnings are turned off for the rest of the session -- or until some
VBA code or a macro turns them back on.
For right now, you can easily turn the warnings back on. Press <CTRL><G> to
open the Immediate Window and paste the following line of code, then press
the <ENTER> key to execute it:
DoCmd.SetWarnings True
Now when you make changes to your form, you will be prompted before the form
closes on whether or not you want to save those changes.
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs:
www.DataDevilDog.BlogSpot.com,
www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.