Microsoft KB Archive/90167

{|
 * width="100%"|

INF: How to Temporarily Disable a Macro Action
'Article ID: Q90167

Creation Date: 11-OCT-1992

Revision Date: 30-NOV-1996' The information in this article applies to:


 * Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97

SUMMARY

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

Programming languages, such as Visual Basic for Applications and Access Basic, typically provide a way for you to temporarily disable any line of code. For example, in Visual Basic (Access Basic in version 2.0 and earlier), you can place a REM command at the beginning of a line of code so that the line of code does not run. This feature is useful when you are debugging several lines of code because it enables you to determine which line of code is causing an error by disabling one line at a time until the error no longer occurs.

This method can also be useful for debugging macros. This article describes how you can temporarily disable a macro line.

MORE INFORMATION

To disable a macro action line without deleting it, follow these steps:


 * 1) Open the macro sheet containing the line you want to disable.
 * 2) If there is no Condition column in the macro sheet, click Conditions on the View menu to insert the Condition column.
 * 3) In the Condition column, on the line you want to disable, type &quot;False&quot; (without the quotation marks) if there is no condition for that line, or type &quot;False And&quot; (without the quotation marks) if there is already a condition for that line.

When you run the macro, the Condition for the macro action will be evaluated as FALSE and the line will be ignored.
 * }

-

"THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY." '' ©1997 Microsoft Corporation. All rights reserved. Legal Notices.

''

KBCategory: kbusage kbhowto

KBSubcategory: McrCond

Additional reference words: 1.00 1.10 2.00 7.00 97 8.00 remark