Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function removeCommon(strName As String)
If InStr(strName, "Law Office of ") = 1 Then
strName = Replace(strName, "Law Office of ", "")
End If
If InStr(strName, "The Law Offices of ") = 1 Then
strName = Replace(strName, "The Law Offices of ", "")
End If
If InStr(strName, "The Firm of ") = 1 Then
strName = Replace(strName, "The Firm of ", "")
End If
If InStr(strName, "Law Firm of ") = 1 Then
strName = Replace(strName, "Law Firm of ", "")
End If
removeCommon = strName
End Function
[blue] Dim strSearch As String
strSearch = Mid("FieldName",16,5)[/blue]
[blue]Mid("FieldName",16,5)[/blue]
[blue]Like "*" & Mid("FieldName",16,5) & "*"[/blue]
strSQL="Select JournalTitle From tblJournals " _
& "Where JournalTitle Like '*" & txtTextbox & "*'"
Me.RecordSource=strSQL
ShortName = removeCommon(Name)
Often you will see a long list with names that start with "The", "An", "A" etc not included in the sort order. So "The Beatles" would appear under "B" not "T".How would you approach sorting for search tables and combo boxes etc.
Remou said:It seems to me that to sort by anything but the full name can only lead to problems as the logic must then be explained to each new person.
Remou said:The user can be shown how to create these abbreviations
The same problem occurs if you strip the common phrase directly in the query, so I don't see how that is an argument against my method. The only difference is my query will run faster.Remou said:If data-entry people mis-spell the full name or omit one of the common words, automation will fail to strip the common phrase