DCrake
Remembered
- Local time
- Today, 15:19
- Joined
- Jun 8, 2005
- Messages
- 8,626
This little demo uses a soundex index to search for similar sounding names in a database.
How to incorperate into your application:
Create a new field in your selected table:
Name: FldSoundexCode
Type: Long Integer
Create a new query and bring down the field you want to perform the soundex search on and the above field.
In a new column
Sn:GetSoundex([YourTextFieldHere])
Run the query. This should bring up 3 columns
Col1 : Your text field
Col2 : Your new empty field
Col3 : The soundex value of the text field
Highlight column 3 and select copy
Highlight column 2 and select paste.
Design the module ModSoundex as bring up the Function CheckForSimilarSurnames()
edit this line
Change it to match your table name and field name
Edit this line
strItems = strItems & rs("fldNameforLetter") & ";"
Change this to match any field(s) in yout table
Save and Close module
View the vba in the form FrmSoundexDemo to see how to use in your application.
David
How to incorperate into your application:
Create a new field in your selected table:
Name: FldSoundexCode
Type: Long Integer
Create a new query and bring down the field you want to perform the soundex search on and the above field.
In a new column
Sn:GetSoundex([YourTextFieldHere])
Run the query. This should bring up 3 columns
Col1 : Your text field
Col2 : Your new empty field
Col3 : The soundex value of the text field
Highlight column 3 and select copy
Highlight column 2 and select paste.
Design the module ModSoundex as bring up the Function CheckForSimilarSurnames()
edit this line
Code:
sStr = "Select * From TblPeople Where FldSoundexCode=" & Val(xSoundex)
Change it to match your table name and field name
Edit this line
strItems = strItems & rs("fldNameforLetter") & ";"
Change this to match any field(s) in yout table
Save and Close module
View the vba in the form FrmSoundexDemo to see how to use in your application.
David