Microsoft KB Archive/89591

= ACC: Error Function Does Not Return Detailed Information =

Article ID: 89591

Article Last Modified on 5/9/2003

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q89591



Moderate: Requires basic macro, coding, and interoperability skills.



SUMMARY
When you use the Error(Err) function to trap errors in Access Basic, you will receive a limited error message. To receive an extended error message, use the Error or Error$ functions. For example, Error(Err) or Error$(Err) might return the message &quot;Table not found&quot; whereas Error or Error$ would return the message &quot;Table MyTable not found.&quot;



MORE INFORMATION
The following is an example of a common format for error handling in Access Basic using MsgBox to display the error text:

MsgBox &quot;Error #&quot; & Err & &quot;: &quot; & Error(Err)

This line would return an error message like &quot;Error #15: File | Not found&quot; if Err had trapped a &quot;file not found&quot; error.

To receive the extended error message use:

MsgBox &quot;Error #&quot; & Err & &quot;: &quot; & Error

Note the use of Error and not Error(Err).

Error(Err) returns a generic error message for the given error number whereas Error returns a specific error message.

NOTE: This behavior does not occur in Microsoft Access version 7.0.

Additional query words: pipe

Keywords: kbinfo kbprogramming KB89591

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.