Supress "Save" prompt after resizing form by code?

  • Thread starter Thread starter Ed from AZ
  • Start date Start date
E

Ed from AZ

I use DoCmd.MoveSize to resize my form on Form_Load and in the code of
two buttons. How can I supress the "Do you want to save changes to
the design?" message when I close?

I tried setting Me.Dirty = False, but the code kept coming back as an
invalid reference to Dirty - I finally realized that when it hit that
spot, the database window was becoming the active window and the
object of "Me", and probably doesn't have a Dirty property.
Everywhere else I use Me to refer to the controls, it works just fine.

Ed
 
Ed,
use of DoCmd.MoveSize does not usually give that message.
If you don't want to save design changes you can add acSaveNo
DoCmd.Close acForm, Me.Name, , acSaveNo

Jeanette Cunningham
 
Thank you for responding, Jeanette.

Just realized I am forgeting to mention that I'm using Access 2003.
And I'm getting this message when I'm using the X to quit the form.

Would I put this in Form_Unload or Form_Close?

Ed
 
I would think in the form unload - if not working as you want, try the close
event.

Jeanette Cunningham

Thank you for responding, Jeanette.

Just realized I am forgeting to mention that I'm using Access 2003.
And I'm getting this message when I'm using the X to quit the form.

Would I put this in Form_Unload or Form_Close?

Ed
 
I finally resolved the issue by simply putting DoCmd.Save after each
instance of resizing the form.

Ed
 
Glad you found a fix.

Jeanette Cunningham

I finally resolved the issue by simply putting DoCmd.Save after each
instance of resizing the form.

Ed
 
Back
Top