access doesnt ask me if i want to save changes or not

  • Thread starter Thread starter Matthew Tiojanco
  • Start date Start date
M

Matthew Tiojanco

When I am working in design view and I close the window I am not asked
if I want to save my changes. This is a pain to me because many times
I don't want to save changes, but it automatically does save without
asking me.

Any ideas? Thanks for the help in advance!
 
Make backup(s) of each form before working on them: right-click on the name
of the form in the database window and choose "Save as ...". Will help if
you add a proper version number (v0, v1, v2, ...)
 
I know how to make backups but that's pretty tedious to do it that
way, when sometimes I just do little changes. It use to ask me if I
want to save "yes/no/cancel."

Thanks for your input though!
 
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.
 
Back
Top