Anonymous

Microsoft Access: What Is The Command Syntax To Replace Every 4th Character With A Space?

1

1 Answers

Anonymous Profile
Anonymous answered
Use the Left( and Right( string functions to select the spaces to the left and to the right of the fourth character. The join them together.
ILen = Len(MyString) - to find the length of the string
strLeftstring = Left(MSstring, 3) - to select the three characters to the left of the fourth character
strRightstring = Right(MyString,(iLen - 5) ' start one character to the right
strNewString = strLeftString + " " + strRightString

Update into the database
rs1!FieldNameToUpdate = strNewString
rs1.Update

Answer Question

Anonymous