how what is this "Option Explicit Statement"

techexpressinc

Registered User.
Local time
Today, 17:16
Joined
Nov 26, 2008
Messages
185
Some of my form screens are poping up slow.
So, I did the performance analysis .
It came back that a batch of my forms to
"Use an Option Explicit statement".

How do i do this?
These forms do not have macro code, they do have queries only.

Thx

Russ
 
At the top of your code modules simple put:

Option Explicit

You'll have to go back and do this manually at this point but you can turn this on by default. I think it's vba editor -> Tools->Options->Require Variable Declaration
 
Option explicit is used in Code only, it means that you have to Explicitly declare (DIM) variables before you can use them.
 
however, this might be an explanation of some problems, but is unlikely to be connected with slow performance

it just helps you write better code.
 
And why the analyzer would say this for modules with no code? It can't assume you will never use code so it needs to let you know that as that is a "best practice."
 
I think if a forms module had no code then it would not need a module.
If it had no module then it would not need Option Explicit.

So, if you have a module with no code then set Has Module to No.
 
Slow performance for forms based on queries usually means bad indexes or no indexes or some other problem in terms of how the data gets ordered. Are the queries all simple queries with no VBA-callable functions?
 

Users who are viewing this thread

Back
Top Bottom