Solved Option Explicit?

However, VBA in Access is compile-on-need, not necessarily every time you launch a form or report.

Although that is the default, it depends on the VBE settings

1753812520214.png


From the VBE Options help:
Compile On Demand: Determines whether a project is fully compiled before it starts, or whether code is compiled as needed, allowing the application to start sooner.

Background Compile: Determines whether idle time is used during run time to finish compiling the project in the background. Background Compile can improve run time execution speed. This feature is not available unless Compile On Demand is also selected.
 
Although that is the default, it depends on the VBE settings

Thanks, Colin. It has been so long since I had to worry about those options that I had forgotten them. Was that always an option or do you recall when that option was introduced?
 
That option has existed since at least A97 (i.e. before the Office VBE was integrated into Access) and has always been on by default.
As mentioned in post #9, Require Variable Declaration was also on by default in A97

1753908007501.png


The VBE was added in A2000 and its Options menu looked almost identical to that in current versions of Office

1753908232961.png


However, as I also mentioned in post #9, from A2000 onwards, Require Variable Declaration became disabled by default in line with Excel & Word.

1753908340674.png
 
No. As noted in post 23, line "Option Explicit" has to be manually added to existing modules. All the property setting does is automatically include this line in new modules.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom