ACC: "Application-defined or object-defined error" ErrorLast reviewed: May 7, 1997Article ID: Q139041 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability 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:
Application-defined or object-defined errorYou may receive this error message when you try to get the description of an error trapped in a form's Error event as follows:
Private Sub Form_Error(DataErr As Integer, Response As Integer) MsgBox Error(DataErr) Response = acDataErrContinue End Sub CAUSEThe 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.
RESOLUTIONMicrosoft Access 7.0 introduced the new AccessError method that you can use to return the descriptive string associated with a Microsoft Access error as follows:
Private Sub Form_Error(DataErr As Integer, Response As Integer) MsgBox Application.AccessError(DataErr) Response = acDataErrContinue End SubNOTE: The AccessError method will return a string associated only with Microsoft Access errors and Visual Basic errors. It will NOT return descriptive strings associated with data access errors.
MORE INFORMATION
Steps to Reproduce Behavior
REFERENCESFor more information about the AccessError method, search for "AccessError," and then "AccessError method" using the Microsoft Access 97 Help Index. |
Keywords : FmsOthr kberrmsg kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |