Understanding Your VBA Building Blocks

In This Chapter

^ Commenting your code ^ Storing data in variables and constants ^ Repeating chunks of code with loops ^Making decisions with lf...End If statements any programmers begin their careers not so much by writing code WWW from scratch as by acquiring bits of code from books, Web sites, and other resources because that's easier than trying to figure it out from scratch. Plenty of sample code is made available through books and Web sites. Don't worry about "stealing" the code: If folks didn't want you copying their code, they wouldn't have made it accessible to you in the first place!

Whether you plan to write your own code or tweak other people's code, you need to understand some fundamental programming concepts for any of the code to make sense.

You can think of the various programming concepts described in this chapter as the basic building blocks from which all programs are created. As you learn more about Visual Basic for Applications (VBA), you see the same building blocks used to perform many different tasks, in many different settings. The first step, though, is to just be aware that such things exist so that you recognize them when you see them.

The variables, constants, arrays, loops, and decision-making techniques that we present in this chapter are the basic building blocks from which all programs are written. Writing VBA code in Access requires both a basic knowledge of those programming techniques and the ability to work with Access objects (which we cover in Chapter 5).

0 0

Post a comment