Option Explicit

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I analysized my database there was a suggestion to insert "option
explicit" into 2 of my forms. I know to open the module for each form to
insert before the declaration but what do I insert exactly?

Thanks!
 
naiveprogrammer said:
When I analysized my database there was a suggestion to insert "option
explicit" into 2 of my forms. I know to open the module for each form to
insert before the declaration but what do I insert exactly?


The first or second line in EVERY module should be:
OPTION EXPLICIT

You can set an option in the VB window's Tools - Options -
Editor tab - Require Variable Declarations check box to have
this taken care of automatically for all new modules.
 
Ok I've done that. Thanks!

Will this take care of my existing db or will I need to manually add this
myself?
 
Live and learn ;-)
You'll have to do it manually.

Actually, it's possible to put together a VBA procedure to
do it, but, considering your original question, you're
probably not ready for programming at that depth.

If you have a ton of modules, you could probaly find a third
party product that includes that kind of capability. There
might even be a free something out there on the web if you
can find it, but I'll bet you could do it faster by doing it
manually.
 
If you have a ton of modules, you could probaly find a third
party product that includes that kind of capability.

Total Access Analyzer from http://www.fmsinc.com does this (and lots
more) as part of its Code Cleanup feature. But it's *not* cheap.

John W. Vinson[MVP]
 
Gotcha! Well thanks for all the helpful info. I learn eventually! :-)

Thanks again!

Marshall Barton said:
Live and learn ;-)
You'll have to do it manually.

Actually, it's possible to put together a VBA procedure to
do it, but, considering your original question, you're
probably not ready for programming at that depth.

If you have a ton of modules, you could probaly find a third
party product that includes that kind of capability. There
might even be a free something out there on the web if you
can find it, but I'll bet you could do it faster by doing it
manually.
--
Marsh
MVP [MS Access]

Ok I've done that. Thanks!

Will this take care of my existing db or will I need to manually add this
myself?
 
Back
Top