Dont save record if database is closed.

Number11

Member
Local time
Today, 00:13
Joined
Jan 29, 2020
Messages
625
I need to stop a record from being saved when the user closes the database and dots click save button on the form

Seems that if you started a data entery and then stopped and just closes the database the record is saved in the able but blank?
 
You need to set appropriate tests in the BeforeUpdate event to see if the record is valid to be saved.
Basic form validation?
 
There is more to it than that, though. In the specific case of triggering an update by closing the DB, if all you do is stop the update (in the BeforeUpdate event), then you ALSO stop the DB from closing.

Therefore, you will have to determine WHY the BeforeUpdate event fired, since it will also fire on legit updates. This usually leads to a can of worms, something that you just opened with this problem. It IS soluble, but will take some time to design. You have to start by recognizing that the user's desire to close the DB is inconsistent with YOUR desire to protect the database content and then plan a strategy of what you want to do when this conflict of interests is uncovered.
 

Users who are viewing this thread

Back
Top Bottom