Hi
The following code does more than you require but you may be able to modify it to filter anything out of a string. I use it as a matter of course in all Name and Address fields
in the "After Update" event.
Tony
'==================================================
Function Capstring(X)
'==================================================
'
' works on multi-word and hyphenated strings
' and removes user punctuation
'
' checks for ">" to force next char to lowercase
' checks for "<" to force next char to uppercase
'
' checks for hyphen, apostrophe, "mc" and "mac"
' to force next char to uppercase but can be
' modified by ">" (eg "mac>hin" will process as "Machin"

'
' checks for space in multi-word strings
'
'==================================================
Dim Temp1, Temp2 As String, I, J, p1, p2 As Integer, b As Variant
If IsNothing(X) Then
Capstring = Null
Exit Function
End If
Temp1 = Trim(LCase(X))
Temp2 = ""
J = 0
'SCAN INPUT STRING AND FILTER RUBBISH
'On Error Resume Next
For I = 1 To Len(Temp1)
b = Mid$(Temp1, I, 1) 'get ANSI value of the character and
Select Case b 'filter out anything but the following:-
Case "0" To "9", "a" To "z", " ", "'", "-", "<", ">", "&", "(", "

", "/", "#" 'numeric, lcase alpha, space, apostrophe,
Temp2 = Temp2 & b 'hyphen, greater than, less than, ampersand,
J = J + 1 'hash
Case Else
End Select
Next I 'Temp2 is filtered string, j is its length
'CAPITALIZE THE FIRST LETTER AND LOOKS FOR "mac" AND "mc" AS FIRST IN THE STRING
If left$(Temp2, 2) = "mc" Then
Temp2 = UCase(left$(Temp2, 1)) & Mid$(Temp2, 2, 1) & UCase(Mid$(Temp2, 3, 1)) & Mid$(Temp2, 4)
ElseIf left$(Temp2, 3) = "mac" Then
Temp2 = UCase(left$(Temp2, 1)) & Mid$(Temp2, 2, 2) & UCase(Mid$(Temp2, 4, 1)) & Mid$(Temp2, 5)
Else
Temp2 = UCase(left$(Temp2, 1)) & Mid$(Temp2, 2)
End If
'NOW LOOK FOR " mc" AND " mac" IN THE REST OF THE STRING
p1 = InStr(Temp2, " mac"

p2 = InStr(Temp2, " mc"
If p1 <> 0 Then
Temp2 = left$(Temp2, p1 + 3) & UCase(Mid$(Temp2, p1 + 4, 1)) & Mid$(Temp2, p1 + 5)
ElseIf p2 <> 0 Then
Temp2 = left$(Temp2, p2 + 2) & UCase(Mid$(Temp2, p2 + 3, 1)) & Mid$(Temp2, p2 + 4)
End If
'NOW PROCESS THE ARRAY ONE CHARACTER AT A TIME
For I = 1 To J
b = Mid$(Temp2, I, 1)
Select Case b
Case Is = "'", " ", "-", "/", "("
Temp2 = left$(Temp2, I) & UCase(Mid$(Temp2, I + 1, 1)) & Mid$(Temp2, I + 2)
Case Is = ">"
Temp2 = left$(Temp2, I - 1) & LCase(Mid$(Temp2, I + 1, 1)) & Mid$(Temp2, I + 2)
J = J - 1
Case Is = "<"
Temp2 = left$(Temp2, I - 1) & UCase(Mid$(Temp2, I + 1, 1)) & Mid$(Temp2, I + 2)
J = J - 1
End Select
Next I
Capstring = Temp2
End Function