Skip to content

Option Explicit

Option Explicit – to use or not to use?

Q:  Matt Perelstein writes: “I was wondering what you thought about using Option Explicit?  It used to be a default, included with each module, but I noticed that in Access 2003, it’s not any more.  I’ve used it religiously for years, but now I’m wondering why.”

A:  I think you should always use it, to catch any undeclared variables.  It should be the default setting, in my opinion.  For one thing, it catches typos that could inadvertently create two different variables, where you intended to use the same variable in different places.

About this author