Indent Outdent

The Editor tab in the Options window contains many settings you can turn on to make automated features available in the Code window.

Figure 2-13: The Options window lists features you can turn on and off to fit the VBA programming environment to your needs.

If the Auto Indent option is turned on, you can automatically indent the selected lines of code the number of characters specified in the Tab Width text box. The default entry for Auto Indent is four characters. You can easily change the tab width by typing a new value in the text box. Why would you want to use indentation in your code? Indentation makes your VBA procedures more readable and easier to understand. Indenting is especially recommended for entering lines of code that make decisions or repeat actions.

Let's see how you can indent and outdent lines of code using the Orders form in the Northwind database.

Introduction to Access 2003 VBA Programming

0 0

Post a comment