Option Explicit and Undefined #Const...

P

PACALA_BA

Option Explicit
#Const gflgCompileATR = False
#Const gflgCompileALL = False
#If gflgUndefined Then
something...
#End If
----------------------
Compiling ....O.K.
gflgUndefined..is Un-defined constant, it is O.K....?


----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...-979a-360e0976b31c&dg=microsoft.public.access
 
D

Douglas J. Steele

There's no point posting your issues as suggestions to Microsoft. You're not
suggesting anything!

gflgUndefined is not defined anywhere in what you've posted, so why do you
think that Access is wrong?
 
D

david

"Option Explicit" has nothing to do with #Const and #If

And #Const and #If have nothing to do with VBA variables
and Option Explicit.

Undefined #Const's are False in A97, I'm not sure about A2000+
Note that you can also define Conditional Compilation Arguments
as a database option.

In the current versions of Access, VBA attempts to compile the
code even inside false #If /#End If groups, which is really stupid.

Also, you can't use the "Conditional Compilation Arguments"
database option if you are trying to make an MDE. (Because
the option applies to 'Current Database Only', and an MDE
is never the Current Database at the moment it is being compiled).

Together, these two limitations means that #If isn't much use.

#If did retain limited value as way to include special A2000
code in A97-compatible applications, but even that is a long time
ago now.

(david)
 

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