Sandy:
You can parse the string and insert a space before each upper case
character. First add this function to a standard module in the database:
Public Function InsertSpaces(varText As Variant) As Variant
Dim n As Integer, intTextlength As Integer
Dim strTemp As String, strChr As String
If Not IsNull(varText) Then
intTextlength = Len(varText)
strTemp = Left$(varText, 1)
For n = 2 To intTextlength
strChr = Mid$(varText, n, 1)
If Asc(strChr) = Asc(UCase(strChr)) Then
strTemp = strTemp & " " & strChr
Else
strTemp = strTemp & strChr
End If
Next n
InsertSpaces = strTemp
End If
End Function
The function works by walking through each character in the string and
comparing the ASCII value of it with the ASCII value of its upper case
character. If the values are the same the character is in upper case so a
space is inserted before it. You can call it in an update query to update
the values of the fields by inserting spaces, e.g.
UPDATE MyTable
SET Field1 = InsertSpaces(Field1),
Field2 = InsertSpaces(Field2);
If you data includes people watch out for any names like MacDonald as this
will become Mac Donald (as its my wife's name she would not be amused!).
Also some names use lower case e.g. the Spanish soprano Victoria de los
Angeles who would become Victoriadelos Angeles. And you should always back
up your table before undertaking any large scale update operation like this.
Ken Sheridan
Stafford, England
I have a data set where all of the spaces have been removed and no common
delimiter except for a capital letter for each new word. For example:
[quoted text clipped - 5 lines]
Thank you for your help.
Sandy