Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
  Tip: Specify the Compare argument when using Split, Filter, Replace, Join, or InstrRev in VBA 6  
 
 

These functions were new in VBA 6. One of their arguments is a Compare parameter. This parameter can take the values vbBinaryCompare (compare characters' binary representations), vbTextCompare (compare characters' text), vbDatabaseCompare (for Access only, compare using settings in the database), or vbUseCompareOption (use the setting in the Option Compare statement).

You can also specify an LCID to use a language's comparison method (if the language is supported on your system).

Unfortunately the constant vbDatabaseCompare has value 2, which is also the LCID for Bulgarian. In Access 2000, if you don't specify a Compare parameter and the file contains an "Option Compare Database" statement, then VBA tries to perform comparisons in Bulgarian. If your system doesn't happen to support Bulgarian, you can get an "Invalid procedure call or argument" error.

The solution is to explicitly set the Compare parameter to either vbBinaryCompare, vbBinaryText, or an LCID.

 

Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated