?
Solved

Cancelling a new record

Posted on 2001-06-22
5
Medium Priority
?
245 Views
Last Modified: 2012-08-13
I have a form to enter client names into a large client list that is used in different places throughout my database.  I want to have a submit button and a cancel button.  However, i basically built a form with one single textbox, and if you enter anything into the textbix, it starts a new record and enters the portion of the data.  So, How do I cancel this record?  If i have already entered some of the name, and want to cancel...how do use a "Cancel" button to erase that particular record?  Thanks for the help.
0
Comment
Question by:scrair
[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 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 300 total points
ID: 6218946
Use the Undo method

      ' Abandon the Edit
      ' Note that record may not be dirty if user manually did an undo.
      If frm.Dirty = True Then
        frm.Undo
      End If

Jim.
0
 
LVL 58
ID: 6218952
Ah I was using a form object variable there.  Change that to Me.Undo for it to work within the form.

Jim.
0
 
LVL 2

Expert Comment

by:jack49a
ID: 6219540
The way I do something similar is to have the additions done in a working table.  This table is just like the big final table but without an autonumber.  Then if the user is happy with the record(s) there is a button on the form for the working table to append working table to final table and delete records in working table.  If the user is unhappy, there is another button which just deletes records in the work table (no append).

You can also use the working table idea if you are adding multiple records and want to set a default with effecting the big table.

Jack
0
 
LVL 7

Expert Comment

by:Dedushka
ID: 6221903
Try to play with BeforeInsert event for your form, here you can cancel insertion of new record.
0
 

Author Comment

by:scrair
ID: 6227755
Thanks for all your help Jim
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

764 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