Option Explicit

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!
 
M

Marshall Barton

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.
 
G

Guest

Ok I've done that. Thanks!

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

Marshall Barton

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.
 
J

John Vinson

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]
 
G

Guest

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top