Chapter 1: What the Heck Is VBA?In This Chapter Understanding Visual Basic for Applications (VBA) Using the Visual Basic Editor Discovering code as
Using the Visual Basic Editor580✦ Split bar: This divvies up the screen for you. Drag the Split bar down toseparate the Code window into two independe
Book VIIIChapter 1What the HeckIs VBA?Using the Visual Basic Editor581When the Immediate window is open, you can anchor it to the bottom of theVisual
Using the Visual Basic Editor582Do bear in mind that the Immediate window is just for testing and debug-ging. The Code window is where you type (or pa
Book VIIIChapter 1What the HeckIs VBA?Using the Visual Basic Editor583✦ Project/Library list: This allows you to choose a single library or proj-ect t
Using the Visual Basic Editor584You can search the Object Library for information about any object, includ-ing DoCmd, by following these steps:1. In t
Book VIIIChapter 1What the HeckIs VBA?Using the Visual Basic Editor585Referring to objects and collectionsObjects in the object model all have a synta
Using the Visual Basic Editor586At the risk of confusing matters, typing the following line in the Immediatewindow returns the same result:? CurrentPr
Book VIIIChapter 1What the HeckIs VBA?Discovering Code as You Go587Closing the Visual Basic EditorWhen you’re done working in the Visual Basic Editor,
Discovering Code as You Go588When you convert a macro to VBA code, you actually convert all the macrosin the macro group to code. Follow these steps f
Book VIIIChapter 1What the HeckIs VBA?Discovering Code as You Go589A dialog box appears, asking whether you want to include error-handlingcode or comm
Finding VBA Code572✦ Standard modules: Code can also be stored in standard modules. Code instandard modules is accessible to all objects in your datab
Discovering Code as You Go590Cutting and pasting codeMany VBA programmers post examples of code they’ve written on Webpages. When you come across some
Book VIIIChapter 1What the HeckIs VBA?Finding VBA Code573You can also get to a class module from the Event tab of the Property sheetin the Design View
Finding VBA Code574To create a new module, click the Create tab. Then click the arrow under theMacros button and choose Module (Figure 1-4). The Visua
Book VIIIChapter 1What the HeckIs VBA?Enabling VBA Code575Enabling VBA CodeLike any programming language, people can use VBA to create code thatdoes g
Using the Visual Basic Editor576Procedures in a module fall into two major categories: sub procedures andfunction procedures. Both types of procedures
Book VIIIChapter 1What the HeckIs VBA?Using the Visual Basic Editor577you click outside the Visual Basic Editor window, the window may disappearas wha
Using the Visual Basic Editor578The Visual Basic Editor provides many tools designed to help you writecode. Most of the tools are optional and can be
Book VIIIChapter 1What the HeckIs VBA?Using the Visual Basic Editor579Using the Code windowThe Code window is where you type your VBA code. Similar to
Kommentare zu diesen Handbüchern