Close Form Button

W

www

What code is needed in the close form button that asks: Do
you want to save form? Currently, if I close the form, it
will save the information that is on the form without
asking if you want to save it. I am using a add record
button to save the form.
 
H

Howard Brody

The code for closing an object is:

DoCmd.Close acForm, "frmFormName" acSaveYes

Object Type, Object Name, Save

The options for Save are acSaveYes, acSaveNo and
acSavePrompt (ask the user if they want to save)

Remember, data changes are live - you don't need to save a
record once it's entered. Saving a table or form only
saves the object's design. It doesn't affect the data.

Hope this helps!

Howard Brody
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top