ACC: Error() Function Does Not Return Detailed InformationLast reviewed: June 6, 1997Article ID: Q89591 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. 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 "Table not found" whereas Error() or Error$() would return the message "Table MyTable not found."
MORE INFORMATIONThe following is an example of a common format for error handling in Access Basic using MsgBox to display the error text:
MsgBox "Error #" & Err & ": " & Error(Err)This line would return an error message like "Error #15: File | Not found" if Err had trapped a "file not found" error. To receive the extended error message use:
MsgBox "Error #" & Err & ": " & ErrorNote 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |