Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

don't save record and Close form

Posted on 2014-12-12
5
Medium Priority
?
328 Views
Last Modified: 2014-12-12
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
0
Comment
Question by:Ernest Grogg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 40496596
you need a command button to do this (cmdCancel)

private sub cmdCancel_click()

me.undo

docmd.close acform,me.name

end sub
0
 
LVL 26

Expert Comment

by:Nick67
ID: 40496611
Forget it.
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.
0
 
LVL 48

Expert Comment

by:Dale Fye
ID: 40496823
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.
0
 

Author Comment

by:Ernest Grogg
ID: 40496985
I agreed too put the button on the footer....thanks for the tip
0
 
LVL 26

Expert Comment

by:Nick67
ID: 40497013
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
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question