L
Laurel
I have a database with one module. I have set Option Explicit at the top.
I expected this to mean that I would get an error if I used a variable that
I hadn't declared. It turns out it's not working. I found this out by
copying the database to another location and renaming it. When I added my
first little bit of code change, I got a compile error because a variable
hadn't been defined. I verifid that it was possible to use new variables
without declaring them in the original database. In the new database all
undeclared variables are caught. (I found this about be declaring the
variable from the first error, and it found another one.) The new copy is
less than an hour old. All I did was make a new module with one tiny
string function in it. The new module was also EXPLICIT. I deleted the
whole module just to try to isolate the cause of the changed behavior.
Does anyone have an idea about what's going on? Why is EXPLICIT not working
in my first database? Why did it begin to work in the new copy of it?
Option Compare Database
Option Explicit
I expected this to mean that I would get an error if I used a variable that
I hadn't declared. It turns out it's not working. I found this out by
copying the database to another location and renaming it. When I added my
first little bit of code change, I got a compile error because a variable
hadn't been defined. I verifid that it was possible to use new variables
without declaring them in the original database. In the new database all
undeclared variables are caught. (I found this about be declaring the
variable from the first error, and it found another one.) The new copy is
less than an hour old. All I did was make a new module with one tiny
string function in it. The new module was also EXPLICIT. I deleted the
whole module just to try to isolate the cause of the changed behavior.
Does anyone have an idea about what's going on? Why is EXPLICIT not working
in my first database? Why did it begin to work in the new copy of it?
Option Compare Database
Option Explicit