Total Visual SourceBook

Total Visual SourceBook CD and Printed Manual

Microsoft Access/ Office 2016, 2013, 2010, and 2007 Version
is Shipping!

New features in Total Visual SourceBook for Access, Office 2007 and VB6

Supports Access/Office 2016, 2013, 2010 and 2007, and Visual Basic 6.0!

Separate version for Access/Office 2003, 2002, and 2000.

Separate version for:
Access 97/95


View all FMS products for Microsoft AccessAll Our Microsoft Access Products

SourceBook Info:

Why SourceBook?

 

"The code is exactly how I would like to write code and the algorithms used are very efficient and well-documented."

Van T. Dinh, Microsoft MVP

 

 

 

Microsoft Access, Office/VBA, VB6 Modules royalty-free source code libraryMicrosoft Access Modules royalty-free source code libraryMicrosoft Access VBA and VB6 Module Library Free trial of Total Visual SourceBook for Microsoft Access, Office, VB6 and VBA

Class: MetaPhone in Category General VBA/VB6 : Searching and Sorting from Total Visual SourceBook

Class that implements the metaphone string searching algorithm in VBA and VB6.

The metaphone algorithm is similar to the Soundex algorithm but tends to group names together that are more closely related than Soundex does. However, metaphone also tends to produce more matches than Soundex. Similar to Soundex, the metaphone algorithm generates a key value for a word based on the consonants in that word. Metaphone uses more intelligent transformation rules, though, by examining groups of letters, or diphthongs.

Procedure List

Procedure Name

Type

Description

(Declarations) Declarations Declarations and private variables for the CMetaPhone class
Class_Initialize Initialize Set initial values to defaults which may be overridden with property settings
Metaphone Method Calculates the metaphone value of a word
AffectH Private Determine if the character affects "H". The following characters affect "H": C,G,P,S,T
IntToByte Private Perform an unsigned conversion from an integer value to a byte value. This procedure correctly handles any integer value. For example, lngNumber = -1 assigns -1 to the variable lngNumber. However, lngNumber = IntToLong(-1) assigns 65,535 to lngNumber.
IsLetter Private Determine if a character is a letter
IsVowel Private Determine if the character is a vowel
MakeSoft Private Determine if the character should be made soft. The following letters are made soft: E, I, Y.
NoChange Private Determine if the character should be changed. The following characters are not transformed by the MetaPhone algorithm: F, J, L, M, N, R.
NoGHToF Private Determine if "GH" should be changed to "F". G is transformed to F if it is proceeded by H, and the word does not start with B, D, or H.

Example Code for Using Class: MetaPhone

' Example of CMetaphone
'
' To try this example, do the following:
' 1. Create a new form
' 2. Create a command button named 'cmdTest'
' 3. Paste all the code from this example to the new form's module.
' 4. Run the form

Private Sub cmdTest_Click()
  Dim Metaphone As CMetaPhone
  Dim strKeyOne As String
  Dim strKeyTwo As String

  Set Metaphone = New CMetaPhone

  ' Calculate and compare keys
  strKeyOne = Metaphone.Metaphone("Microsoft")
  strKeyTwo = Metaphone.Metaphone("Mikrosopht")

  If strKeyOne = strKeyTwo Then
    Debug.Print "They match!"
  Else
    Debug.Print "They do not match"
  End If

End Sub

Microsoft Access Module LibraryOverview of Total Visual SourceBook

The source code in Total Visual SourceBook includes modules and classes for Microsoft Access, Visual Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily add this professionally written, tested, and documented royalty-free code into your applications to simplify your application development efforts.

Additional Resources