Share this Page URL

Chapter 5. Using Visual Basic to Automat... > Using Standard and Class Modules - Pg. 146

Using Visual Basic to Automate Your Database 146 The Code window in the Visual Basic Editor, shown here, includes two declarations in its Declarations section, Option Compare Database and Option Explicit. The Option Compare Database declaration is included by default in all modules you create in Access. It determines the method by which text strings are compared when they're sorted. The Database designation applies only to Access databases and means that text strings will be sorted on the basis of the locale setting in Control Panel. Option Explicit does not appear by default initially (we've set an option to display it), but you should use it to keep your code more reliable and easier to manage. We'll describe the reasons you should use Option Explicit in more detail (and how to include it in modules by default) later in this chapter.