I need to change the string, such as "it is an access form" , into "ItIsAnAccessForm". Remove the space and display upper cass for the first char of each word. The following code remove the space, but cannot change from lower case to upper case. does anyone has good idea for the case change. Thanks.
Sub SubStringReplace()
Dim iPos As Integer
Dim iStart As Integer
Dim str As String
Dim chr As String
Dim temp As String
str = "it is an Access Form
chr$ = " "
iStart% = 1
Do
'Find beginning position
iPos% = InStr(iStart%, str$, chr$)
'If not there, then get out
If iPos% = 0 Then Exit Do
'Combine left and right portion
str$ = Left(str$, iPos% - 1) & Right(str$, Len(str$) - iPos% - Len(chr$) + 1)
'MsgBox str$
'Calculate where to begin next search
iStart% = iPos%
Loop
end Sub
Sub SubStringReplace()
Dim iPos As Integer
Dim iStart As Integer
Dim str As String
Dim chr As String
Dim temp As String
str = "it is an Access Form
chr$ = " "
iStart% = 1
Do
'Find beginning position
iPos% = InStr(iStart%, str$, chr$)
'If not there, then get out
If iPos% = 0 Then Exit Do
'Combine left and right portion
str$ = Left(str$, iPos% - 1) & Right(str$, Len(str$) - iPos% - Len(chr$) + 1)
'MsgBox str$
'Calculate where to begin next search
iStart% = iPos%
Loop
end Sub