ADT/ODE: End Statement in Run-Time Application Causes ErrorLast reviewed: October 20, 1997Article ID: Q165824 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. If you use the End statement in Visual Basic for Applications code in a run- time application, when the statement is executed, you may receive the following error message and then the application quits:
Execution of this application has stopped due to a run-time error. The application cannot continue and will be shut down.Note that this does not happen in the retail version of Microsoft Access.
CAUSEThe End statement causes a UserReset error in Microsoft Access, which is treated as a run-time error. Run-time errors in a run-time application cause the application to quit. Note that this happens even if your application contains error handling procedures.
RESOLUTIONRewrite your code so it does not use the End statement. If it is appropriate, you can use the Exit Sub or Exit Function statement to exit the procedure. Note, however, that the Exit statement only exits the currently running procedure. If you are running a nested procedure, the main procedure continues to run after you issue the Exit statement, and you must provide a mechanism to exit the main procedure as well.
MORE INFORMATIONIf you use the feature in Microsoft Access 7.0 and 97 that allows you to convert macros into Visual Basic code modules, the StopAllMacros macro action will translate to an End statement in Visual Basic code.
Steps to Reproduce Behavior
REFERENCESFor more information about the End statement, search the Help Index for "End statement." For more information about converting macros to Visual Basic modules, search the Help Index for "converting macros." Keywords : kbcode kberrmsg PgmOthr Version : 7.0 97 Platform : WINDOWS Hardware : x86 Issue type : kbprb Solution Type : Info_Provided |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |