By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 1,756 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

How to Cancel an Unsaved Record

100+
P: 124
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

Share this Question
Share on Google+
2 Replies


TheSmileyCoder
Expert Mod 100+
P: 2,321
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

100+
P: 124
Thanks for your help!
May 14 '10 #3

Post your reply

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