ACC: How to Make the Immediate Window Available at All TimesLast reviewed: August 6, 1997Article ID: Q88925 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. Microsoft Access versions 1.x and 2.0 have a debugging tool called the Immediate window that enables you debug Access Basic code. By using the Immediate window, you can try out an expression to see if it returns the expected value (or any value at all); you can debug macros; you can debug procedures, and so on. However, in the Microsoft Access versions 1.x and 2.0 user interface, the Immediate window is only available when a module window is selected. This article shows you how you can use a macro to make the Immediate window available at all times. For an overview of how to use the Immediate window, see the "Overview of the Immediate Window" section below. For instructions on how to create the macro to make the Immediate Window available at all times, see "Making the Immediate Window Available at All Times" section below. NOTE: In Microsoft Access for Windows 95 version 7.0, the Immediate window is called the Debug window. The Debug Window in Microsoft Access 7.0 is available at all times even without a module open. To open the Debug Window in Microsoft Access 7.0, press CTRL+G.
MORE INFORMATION
Overview of the Immediate WindowYou can type an expression in the Immediate window and see the results of that expression, without having to write and run an Access Basic procedure. To run an expression in the Immediate window, use the Access Basic "?" command (without the quotation marks) as demonstrated below:
? 2 + 2When you type this statement in the Immediate window and press ENTER, Microsoft Access displays the number 4 just below the expression. Another example of using the Immediate window is to set the value of a variable or to test for the value of a variable. For example, to set the value of a variable and then to test for the value of the variable, type the following lines in the Immediate window:
MyVar = 2 ? MyVarThe "?" statement returns the number 2 because that is the value you assigned to the variable MyVar. The Immediate window is helpful for debugging Access Basic code because you can suspend execution of the procedure and set the values of variables in the procedure to see what kind of result you would receive with different values. You can also use the Immediate window to suspend a procedure and check for the value of a variable or expression to see if it is calculating as you expect it to. In the same way that an Immediate window can be helpful for debugging code, it can also be helpful for other tasks, such as:
Making the Immediate Window Available at All TimesYou can make the Immediate window available at all times by following these steps:
Keywords : McrHowto kbprg kbusage PgmOthr Version : 1.0 1.1 2.0 Platform : WINDOWS Hardware : x86 Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |