Article ID: 208704 - View products that this article applies to.
This article was previously published under Q208704
Advanced: Requires expert coding, interoperability, and multiuser skills.
If you use the Error() or Error$() functions to get the textual description of an error message, you may receive the following error message:
You may receive this error message when you try to get the description of an error trapped in a form's Error event as follows:
Application-defined or object-defined error
The error message being trapped is Microsoft Access specific. When you pass an error number to the Error() function that is not a Visual Basic for Applications specific error, Visual Basic for Applications does not call back into the hosting application to ask it for the error message.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. You can use the AccessError method to return the descriptive string associated with an Access error as follows:
NOTE: The AccessError method will return a string associated only with Access errors and Visual Basic errors. It will not return descriptive strings associated with data access errors.
CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.
Steps to Reproduce Behavior
For more information about the AccessError method, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type "AccessError" in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
Article ID: 208704 - Last Review: October 11, 2006 - Revision: 3.2