Download presentation
Presentation is loading. Please wait.
Published byMartin Ryan Modified over 9 years ago
1
Errors Part I Error Messaging Error Handling Conclusion Questions What is an Error What is VBA Types of Errors Error Commands Error Flow Error Trapping Error Handling & other very practical uses for VBA in MS Access 2000 Part I
2
Errors Part I Error Messaging Error Handling Conclusion Questions What is an Error What is VBA Types of Errors Error Commands Error Flow September 13, 2001Error Handling - Part I2 What is VBA Visual Basic for Applications Work with complex logic (Case, Loops…) Allows use of constants and variables Perform Transaction Processing Create and work with DB objects in code Create libraries of user-defined functions Call Windows API functions Perform automation commands Implement Error Handling and Error Trapping
3
Errors Part I Error Messaging Error Handling Conclusion Questions What is an Error What is VBA Types of Errors Error Commands Error Flow September 13, 2001Error Handling - Part I3 What is an Error Every form & report contains an Error event Form engine and report engine differ Triggered by interface or by the engine Error numbers range from 5 to 32,767 Errors in VBA, Access, Jet, SQL, Windows “Application-defined or object-defined error” Some Jet errors use symbol | as placeholder
4
Errors Part I Error Messaging Error Handling Conclusion Questions What is an Error What is VBA Types of Errors Error Commands Error Flow September 13, 2001Error Handling - Part I4 Error Messaging Message displayed when Error Occurs Debug causes the VBE to appear
5
Errors Part I Error Messaging Error Handling Conclusion Questions What is an Error What is VBA Types of Errors Error Commands Error Flow September 13, 2001Error Handling - Part I5 Types of Errors Synchronous Errors –Errors while code is running –Predictable –Most errors occur this way Asynchronous Errors –Errors while code is NOT running –Unpredictable –i.e. Out of memory, network, bad data
6
Errors Part I Error Messaging Error Handling Conclusion Questions What is an Error What is VBA Types of Errors Error Commands Error Flow September 13, 2001Error Handling - Part I6 Error Commands On Error –On Error Goto Error_Handler –On Error Resume Next Exit –Exit Sub –Exit Function Resume –Resume Next
7
Errors Part I Error Messaging Error Handling Conclusion Questions What is an Error What is VBA Types of Errors Error Commands Error Flow September 13, 2001Error Handling - Part I7 Error Flow
8
Errors Part I Error Messaging Error Handling Conclusion Questions What is an Error What is VBA Types of Errors Error Commands Error Flow September 13, 2001Error Handling - Part I8 Error Handling Allow error to occur, then resume Substitute error with code Trap error and handle it Bring up Message Box Bring up Input Box Bring up another form Trap Error and Log to Errors Table
9
Errors Part I Error Messaging Error Handling Conclusion Questions What is an Error What is VBA Types of Errors Error Commands Error Flow September 13, 2001Error Handling - Part I9 Conclusion Errors Happen ! Can not trap errors with macros – use VBA Errors in VBA, Access, Jet, SQL, Windows Handle all predictable errors Handle many unpredictable errors Handle all errors “elegantly” Explore Nesting Error Handlers Explore User-Defined Errors
10
Errors Part I Error Messaging Error Handling Conclusion Questions What is an Error What is VBA Types of Errors Error Commands Error Flow September 13, 2001Error Handling - Part I10 Questions Ofer Shimrat Soundoff Computing (858) 484-0400 ofershimrat@compuserve.com Thank You
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.