Option Explicit?

pdbowling

Registered User.
Local time
Today, 21:33
Joined
Feb 14, 2003
Messages
179
Hey all,
I have an Access database with many forms and macros.
It runs fine on my PC but when I move the file to another PC and try to run the Macros, it crashes at the first implicitly declared variable. Option Explicit is NOT in the code. Is there a setting in Access that is causing this "Can not find object" error?

Also, I tried declaring everything which worked for the variables, but I open Excel in a macro and it really gets buggy there. Any help would be much appreciated.
PB
 
If you had Option Explicit and you tried to implicitly define a variable, you'd get the "Variable not defined" error.

Can you post some of your code, especially the line giving you the "Can not find object" error?
 
Bwa ha

Hi, thanks for responding. I had a buddy drop by my desk and look at the code and said
"where is 'Option Compare Database' ?"

Well that fixed it all. Sometimes the answers are too simple to see.
Thanks
PB
 
I have seen the option compare database statement before and used it. Will anyone who knows it's true meaning (in words that a simple person can understand) please explain it. Thanks in advance. The following is all I have found in MS - specifically the MSDN site on the subject:

Option Compare Statement
See Also Example Specifics

Used at module level to declare the default comparison method to use when string data is compared.

Syntax

Option Compare {Binary | Text | Database}

Remarks

If used, the Option Compare statement must appear in a module before any procedures.

The Option Compare statement specifies the string comparison method (Binary, Text, or Database) for a module. If a module doesn't include an Option Compare statement, the default text comparison method is Binary.

Option Compare Binary results in string comparisons based on a sort order derived from the internal binary representations of the characters. In Microsoft Windows, sort order is determined by the code page. A typical binary sort order is shown in the following example:

A < B < E < Z < a < b < e < z < À < Ê < Ø < à < ê < ø

Option Compare Text results in string comparisons based on a case-insensitive text sort order determined by your system's locale. When the same characters are sorted using Option Compare Text, the following text sort order is produced:

(A=a) < ( À=à) < (B=b) < (E=e) < (Ê=ê) < (Z=z) < (Ø=ø)

Option Compare Database can only be used within Microsoft Access. This results in string comparisons based on the sort order determined by the locale ID of the database where the string comparisons occur.
 

Users who are viewing this thread

Back
Top Bottom