Help, Yes/No, Message Box, If statement

Potato207

New member
Local time
Today, 23:12
Joined
Dec 2, 2015
Messages
2
Hello, I have been trying to create a button with a code which will have the function of asking the user to close the database, and if they want to close it, it will save and if they do not, the event will be cancelled. I am wondering if I can accomplish this, and if so, how can I, many thanks :c
 
Sorry I meant the database/records u-u
 
Unless you are using unbound forms, as soon as the user navigates away from the record (ie. moves to a different record, closes the form, closes the database) the record and all changes will be saved. This is the way that access handles saving, you don't have to explicitly save unless you have set up your forms to operate specifically without it.
 
To close/exit the database you can use this :
Code:
DoCmd.Quit acQuitSaveAll
This will close the complete access database.
 

Users who are viewing this thread

Back
Top Bottom