473,394 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to Cancel an Unsaved Record

124 100+
My main form has a tab control. Each tab contains a table bound subform in which you can enter records. My one subform has a couple of combobox controls that are bound to required table fields. If I'm beginning to enter a record but change my mind half-way through selecting values in all the required fields and click on a different tab to cancel out, I get the error that I have to enter a value for the next required field. At this point I'm stuck (unless I decide to just select values anyway and then delete the record which I don't want to do). The only way I can get out is to close the form entirely so I get the "You can't save this record at this time" error and I select Yes to wanting to close the object. This will be bad for my users because closing my main form will require them to close out of the application entirely and reopen it since they won't have access to the NavPane to reopen the form. Therefore, how do you cancel an unsaved (or is it "uncommitted"?) record?
May 12 '10 #1

✓ answered by TheSmileyCoder

You can press ESC to undo your current record. You can also make a undo button, with code:
Expand|Select|Wrap|Line Numbers
  1. Private sub btn_Undo_Click()
  2.   Me.Undo
  3. End Sub

2 5065
TheSmileyCoder
2,322 Expert Mod 2GB
You can press ESC to undo your current record. You can also make a undo button, with code:
Expand|Select|Wrap|Line Numbers
  1. Private sub btn_Undo_Click()
  2.   Me.Undo
  3. End Sub
May 12 '10 #2
bullfrog83
124 100+
Thanks for your help!
May 14 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Sue | last post by:
As soon as a character is entered in the first field of a new record, the number of records shown in the navigation buttons increases by 1 and the new record button becomes enabled. In the...
6
by: Nothing | last post by:
I have a form that opens. On this form there is information along with a button that opens a payment form. The payment form opens and I enter a payment type, cash check or charge, a payment...
3
by: Prakash | last post by:
Below is my code to delete a record in a continuous form. I can't figure out any reason but sometimes (another) record gets deleted instead of where the record pointer is positioned. Small table...
6
by: allyn44 | last post by:
HI--what I am trying to do is 2 things: 1. Open a form in either data entry mode or edit mode depending on what task the user is performing 2. Cancel events tied to fields on the form if I am in...
0
by: Rachel Suddeth | last post by:
I have a tabbed ap, and I want to provide a message and give the user a chance to change there mind if they try to change tab pages in the middle of an update (otherwise just cancel the update and...
1
by: Kamal Ahmed | last post by:
Hi All, I have a datagrid that contains multiple records. I want to edit any record in grid and then Update or Cancel same record. What is short & easy way to do so. TIA.
3
by: kaosyeti | last post by:
i have a form that has required fields and i have a delete button, created by the wizard, that has this code for onclick: Private Sub cmddeleterecord_Click() On Error GoTo...
1
by: JohnR | last post by:
I normally validate the data in a control in that controls validating event. I also normally have a Cancel button on each form which does a RejectChanges to reset any unsaved data on the form. ...
6
by: John | last post by:
Hi I need to block user from moving away from a record using any of First/Last/Prev/Next/New Record or any other way IF the record has not been saved, and displaying a message to the effect...
7
by: Dale Sampson | last post by:
As you can tell, I am new to VS.net. I have a VB project with a defined data source pointing to a table in a ..mdb file.-- The associated fields are displayed in textboxes using the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.