Ernest Grogg
asked on
don't save record and Close form
Hello,
I have a form and if the data entry person decides not to save the record and closes the form I would like to
Not save the record
close the form
clear any and all errors
I only have the close button (the X on the top of form) and no other buttons...they would click that button to close if they don't want to save the record
I have a form and if the data entry person decides not to save the record and closes the form I would like to
Not save the record
close the form
clear any and all errors
I only have the close button (the X on the top of form) and no other buttons...they would click that button to close if they don't want to save the record
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I agree with Nick and Rey.
Although I leave the X and close options available on most of my forms, I disable those properties on my data entry forms and place Cancel and Save buttons in the form footer. This way, the only way for a user to close a data entry form is to either cancel, or meet all of the requirements for saving the record.
Although I leave the X and close options available on most of my forms, I disable those properties on my data entry forms and place Cancel and Save buttons in the form footer. This way, the only way for a user to close a data entry form is to either cancel, or meet all of the requirements for saving the record.
ASKER
I agreed too put the button on the footer....thanks for the tip
Be warned.
There remain many ways for this to go wrong.
The app crashing
The computer rebooting/power failing/crashing
Network intermittency
Task manager use in killing the app.
Code that switches the focus to another app or form
Other things that don't come to the top of my mind at the moment.
The only certain way to ensure that only data you want entered into the tables is to do it through code yourself as the developer. Everything else is prone to some level of -- perhaps acceptable in your application -- error
There remain many ways for this to go wrong.
The app crashing
The computer rebooting/power failing/crashing
Network intermittency
Task manager use in killing the app.
Code that switches the focus to another app or form
Other things that don't come to the top of my mind at the moment.
The only certain way to ensure that only data you want entered into the tables is to do it through code yourself as the developer. Everything else is prone to some level of -- perhaps acceptable in your application -- error
While it is not impossible to do what you've asked, it is hard enough, and error prone enough, that you do not want to go there. Good data entry forms are always a lot of work to create. MS has created all sorts of nice wizards that create forms backed by live data -- which create, change or alter data willy-nilly based on the actions of the user. Not Good
Proper data entry forms have mechanisms that allow users to prepare their data for entry and that then require a deliberate action to make it so. These are a lot more work to create than the simple wizard forms -- but getting good, clean data into the database is important enough to make it worth the trouble.
Maybe someone else will disagree.