I\'m using Access 2010 under Win7. I\'ve discovered I can dimension my arrays at run-time by simply invoking ReDim arrayName(x)
without first declaring the arr
That's interesting. This MSDN page confirms what you're seeing: Here's a quote:
"You can use the ReDim statement to declare an array implicitly within a procedure. Be careful not to misspell the name of the array when you use the ReDim statement. Even if the Option Explicit statement is included in the module, a second array will be created."
This page explains that Redim
creates a new array and that the existing array is copied into it (assuming there is one):
http://msdn.microsoft.com/en-us/library/w8k3cys2%28v=vs.80%29.aspx
As to your question, should you do it, I'd say no, because it's confusing, and does open your code to errors that Option Explicit won't catch.
Reasonably enough, Redim Preserve
doesn't exhibit this behavior.