|
||||||
Access Developer 46 Building a Microsoft Access Undo System for Orders
WelcomeWelcome to Microsoft Access Developer Level 46, brought to you by Access Learning Zone. I'm your instructor Richard Rost. Today's lessons are going to cover building an undo system for your Microsoft Access database. Access allows you one undo, but what if you're working on an order and you want to undo the last three or four things that you did? An edit, a delete? That's what we're going to cover in today's class. This is going to involve building a change log so we can track exactly what changes are made to the order, then an undo button. We'll have to do three separate cases: undoing edits, additions, and deletions. They're all separate. We'll make a custom delete button. We've done that before, but there are some subtleties with this one. Then we will talk about two significant problems that come up. One, when you delete a record from a table and then restore it with its Autonumber, a problem comes up, and we'll talk about how to fix that. We'll also see how CurrentDB.Execute doesn't ever really give you error messages, and we'll deal with that problem too. ResourcesTopics CoveredIn Lesson 1, we are beginning our undo system. We are going to build a change log table so we can track the undos and the edits in the table. We will write the code to save those changes into the log table. We will build our undo button and begin writing the code to restore the edited record when the user clicks undo. In Lesson 2, we will continue with the undo system. We will finish undoing an edited record, and once the change is made, we will move the focus to that record so the user can see that it was the last one modified and what was undone. In Lesson 3, we will track what type of change was made, whether it was an edit, an addition, or a deletion. We will build a custom delete button to handle deletions instead of relying on the built-in events for delete. Then we will handle undoing a record deletion by adding it back to the order. In Lesson 4, we will address two problems. One is the issue that occurs with auto numbers when you insert an Autonumber back into the table. We will discuss how that is fixed. The second issue involves CurrentDB.Execute and how it does not provide error messages. We will explore how to deal with that problem. In Lesson 5, we will refine the undo system by showing or hiding the undo button based on whether there is anything to undo. For example, if you open a new record, you do not want to see an undo button when there is nothing to undo. We will also make the undo button show the last action item, such as whether it was an edit, an addition, or a deletion. Enroll TodayEnroll now so that you watch these lessons, learn with us, post questions, and more! Questions?Please feel free to post your questions or comments below. If you are not sure as to whether or not this product will meet your needs, I'd rather help you before you buy it. Remember, all sales are final. Thank you. Keywordsmicrosoft access, access 2016, access 2019, access 2021, access 365, ms access, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #instruction, #learn, #lesson, #training, #database, undo system, change log table, save changes code, undo button, restore edited records, undo additions, undo deletions, restore deleted records, auto number issues, custom delete button, CurrentDB.Execute errors, error handling in VBA, Access record recovery, Access transaction log, VBA undo functionality
|
||
| |||
Keywords: access developer 46 undo system, change log table, save changes code, undo button, restore edited records, undo additions, undo deletions, restore deleted records, auto number issues, custom delete button, CurrentDB.Execute errors, error handling in VBA, Page Tag: whatsnew PermaLink Microsoft Access Developer 46 |