Sorry, should have said SQL and not function. This is the function.
Public Function Capitalize(str As String)
Dim i As Integer
Dim wasspc As Boolean
wasspc = True
For i = 1 To Len(str)
If wasspc Then
str = Left$(str, i - 1) & UCase(Mid(str, i, 1)) & Right(str, Len(str) - i)
End If
wasspc = IIf(Mid(str, i, 1) = " ", True, False)
Next i
Capitalize = str
End Function